From 67a31fd20082081506ea93387b4b442ed0127ced Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 24 Jun 2009 00:37:44 +0000 Subject: [PATCH] * follow-up to r52301: make it more clear what this loop is trying to accomplish (per suggestion by werdna on IRC). --- includes/Title.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; -- 2.20.1