• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revision2cf98c47a812b551b49500971fd75964e59a7dee (tree)
Time2022-03-27 01:49:30
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2565 Fix read_auth and edit_auth apply condition

* if $read_auth is 0, is_page_readable() always returns TRUE
* if $edit_auth is 0, is_page_writable() always returns TRUE

Change Summary

Incremental Difference

--- a/lib/auth.php
+++ b/lib/auth.php
@@ -244,7 +244,10 @@ function check_editable($page, $auth_enabled = TRUE, $exit_on_fail = TRUE)
244244 * Whether the page is readable from current user or not.
245245 */
246246 function is_page_readable($page) {
247- global $read_auth_pages;
247+ global $read_auth_pages, $read_auth;
248+ if (!$read_auth) {
249+ return TRUE;
250+ }
248251 return _is_page_accessible($page, $read_auth_pages);
249252 }
250253
@@ -252,7 +255,10 @@ function is_page_readable($page) {
252255 * Whether the page is writable from current user or not.
253256 */
254257 function is_page_writable($page) {
255- global $edit_auth_pages;
258+ global $edit_auth_pages, $edit_auth;
259+ if (!$edit_auth) {
260+ return TRUE;
261+ }
256262 return _is_page_accessible($page, $edit_auth_pages);
257263 }
258264
Show on old repository browser