jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/398519 )
Change subject: Fix two bugs with lockdownNamespace()
......................................................................
Fix two bugs with lockdownNamespace()
* Changing search's behavior for “go to page” by actually setting
$title to null.
* Allow the general public to see namespaces without any group restrictions.
Change-Id: Icaf433663311f36f0893a7ec4b660c954fa1b5e6
---
M Lockdown.php
1 file changed, 5 insertions(+), 8 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
Thiemo Kreuz (WMDE): Looks good to me, but someone else must approve
diff --git a/Lockdown.php b/Lockdown.php
index 9deef15..c770e76 100644
--- a/Lockdown.php
+++ b/Lockdown.php
@@ -200,12 +200,7 @@
$groups = @$wgNamespacePermissionLockdown[$ns]['*'];
}
- if ( $groups === null ) {
- return false;
- }
-
- if ( !$groups || !array_intersect($ugroups, $groups) ) {
- $title = null;
+ if ( is_array( $groups ) && !array_intersect($ugroups, $groups) ) {
return false;
}
@@ -213,11 +208,13 @@
}
#Stop a Go search for a hidden title to send you to the login required page.
Will show a no such page message instead.
-function lockdownSearchGetNearMatchComplete( $searchterm, Title $title = null
) {
+function lockdownSearchGetNearMatchComplete( $searchterm, Title &$title = null
) {
global $wgUser;
if ( $title ) {
$ugroups = $wgUser->getEffectiveGroups();
- return lockdownNamespace( $title->getNamespace(), $ugroups );
+ if ( !lockdownNamespace( $title->getNamespace(), $ugroups ) ) {
+ $title = null;
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/398519
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icaf433663311f36f0893a7ec4b660c954fa1b5e6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Lockdown
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits