From: Ryan Schmidt Date: Wed, 24 Jun 2009 00:37:44 +0000 (+0000) Subject: * follow-up to r52301: make it more clear what this loop is trying to accomplish... X-Git-Tag: 1.31.0-rc.0~41233 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=67a31fd20082081506ea93387b4b442ed0127ced;p=lhc%2Fweb%2Fwiklou.git * follow-up to r52301: make it more clear what this loop is trying to accomplish (per suggestion by werdna on IRC). --- diff --git a/includes/Title.php b/includes/Title.php index d7c65bb597..762adc5e19 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1494,8 +1494,14 @@ class Title { # Not a public wiki, so no shortcut $useShortcut = false; } elseif( !empty( $wgRevokePermissions ) ) { - foreach( array_keys( $wgRevokePermissions ) as $group ) { - if( !empty( $wgRevokePermissions[$group]['read'] ) ) { + /* + * Iterate through each group with permissions being revoked (key not included since we don't care + * what the group name is), then check if the read permission is being revoked. If it is, then + * we don't use the shortcut below since the user might not be able to read, even though anon + * reading is allowed. + */ + foreach( $wgRevokePermissions as $perms ) { + if( !empty( $perms['read'] ) ) { # We might be removing the read right from the user, so no shortcut $useShortcut = false; break;