* follow-up to r52301: make it more clear what this loop is trying to accomplish...
authorRyan Schmidt <skizzerz@users.mediawiki.org>
Wed, 24 Jun 2009 00:37:44 +0000 (00:37 +0000)
committerRyan Schmidt <skizzerz@users.mediawiki.org>
Wed, 24 Jun 2009 00:37:44 +0000 (00:37 +0000)
includes/Title.php

index d7c65bb..762adc5 100644 (file)
@@ -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;