# 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;