r87897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87896‎ | r87897 | r87898 >
Date:01:12, 12 May 2011
Author:skizzerz
Status:resolved (Comments)
Tags:
Comment:
* (bug 28842) Fix userrights issue on 1.16.5 with the Lockdown extension (check for partially initialized $wgUser before continuing with SearchableNamespaces hook)
Modified paths:
  • /trunk/extensions/Lockdown/Lockdown.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lockdown/Lockdown.php
@@ -136,6 +136,12 @@
137137
138138 function lockdownSearchableNamespaces($arr) {
139139 global $wgUser, $wgNamespacePermissionLockdown;
 140+
 141+ //don't continue if $wgUser's name and id are both false (bug 28842)
 142+ if ( $wgUser->getId() === NULL && $wgUser->getName() === NULL ) {
 143+ return true;
 144+ }
 145+
140146 $ugroups = $wgUser->getEffectiveGroups();
141147
142148 foreach ( $arr as $ns => $name ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r87901* Followup r87897: coding convention fixes in Lockdown and clarify a poorly-w...skizzerz06:36, 12 May 2011

Comments

#Comment by Nikerabbit (talk | contribs)   05:37, 12 May 2011

Lower case null is preferred.

#Comment by Bawolff (talk | contribs)   05:41, 12 May 2011

The comment is slightly confusing, given that null !== false.

#Comment by Skizzerz (talk | contribs)   06:26, 12 May 2011

I used uppercase NULL because uppercase NULL was used later on in the function, so I wanted to keep the style consistent in the extension. I am aware that lowercase is preferred. I'll do a followup commit with stylistic changes and reword the comment to be less confusing.

#Comment by MarkAHershberger (talk | contribs)   23:06, 12 May 2011

to support 1.16.5 this needs to be ported to the REL_1_16 branch

#Comment by Reedy (talk | contribs)   15:59, 25 May 2011

And 1.17, and 1.18...

Status & tagging log