r75759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75758‎ | r75759 | r75760 >
Date:23:14, 31 October 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
userNotPrivilegedMessage being called with no parameter. Guessing it needs to be the missing right...?
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -291,7 +291,7 @@
292292
293293 # Check permissions
294294 if ( !$wgUser->isAllowed( 'createaccount' ) ) {
295 - $this->userNotPrivilegedMessage();
 295+ $this->userNotPrivilegedMessage( 'createaccount' );
296296 return false;
297297 } elseif ( $wgUser->isBlockedFromCreateAccount() ) {
298298 $this->userBlockedMessage();

Follow-up revisions

RevisionCommit summaryAuthorDate
r77617Fix r75759: replace call to userNotPrivilegedMessage() with a call to OutputP...werdna23:59, 2 December 2010

Comments

#Comment by 😂 (talk | contribs)   20:16, 4 November 2010

This doesn't look right. That param to userNotPrivilegedMessage() gets passed to OutputPage::formatPermissionsErrorMessage(), which expects it to be an array of errors (see its docs). Seeing as this is the only caller and it wasn't using the param at all, I'm wondering why it was needed (it was added in r35224)

#Comment by Reedy (talk | contribs)   20:44, 4 November 2010

Drop the parameter from the definition and revert this?

#Comment by 😂 (talk | contribs)   22:43, 4 November 2010

Maybe. We need to make sure the right message(s) are getting passed to the end-user though.

#Comment by Reedy (talk | contribs)   22:57, 4 November 2010

As opposed to calling the method wrongly? ;)

#Comment by 😂 (talk | contribs)   22:58, 4 November 2010

Well of course that should be fixed. But fixed as in just reverted or fixed as in a different approach is still up for debate :)

#Comment by Reedy (talk | contribs)   23:32, 4 November 2010

Well, a full revert is not right. At worse, we just change it to , to match the method signature...

#Comment by Werdna (talk | contribs)   23:23, 2 December 2010

You probably want to use OutputPage::permissionRequired() instead.

#Comment by Werdna (talk | contribs)   23:59, 2 December 2010

Done in r77617

Status & tagging log