MediaWiki r85025 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r85024‎ | r85025 (on ViewVC)‎ | r85026 >
Date:18:00, 30 March 2011
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
(bug 23408) give admins a warning before letting them block themselves. Also tweak the logic so that loading the interface for one already-blocked user, then actually submitting a block on a different user, shows the confirmation again if the second user is already blocked.
Modified paths:

Diff [purge]

Loading diff…

Sign-offs

UserFlagDate
Nikerabbitinspected18:20, 30 March 2011

Follow-up revisions

Rev.Commit summaryAuthorDate
r85042Follow-up r85025 - use strict comparisonhappy-melon20:05, 30 March 2011
r85166Follow-up r85025: fix the you're-trying-to-block-yourself-you-twit warning, a...happy-melon23:13, 1 April 2011
r93233* Fix double-escaping from r85025...happy-melon19:04, 26 July 2011
r94235Followup r85025, r85166, r93233: use strict comparison per CR comment, becaus...catrope10:33, 11 August 2011

Comments

#Comment by Nikerabbit (talk | contribs)   18:20, 30 March 2011
+if( $target == $wgUser->getName()
> var_dump( "0" == "00" );
bool(true)

Although it is ignored in html, I see no reason to use two spaces after a dot.

#Comment by Catrope (talk | contribs)   10:34, 11 August 2011

Fixed in r94235. All comments are resolved now.

#Comment by Happy-melon (talk | contribs)   20:08, 30 March 2011
#Comment by Bawolff (talk | contribs)   20:42, 31 March 2011

I can't figure out how to block my self now. I get the warning, but don't see any way to say "yes as a matter of fact I really do want to block myself"

#Comment by Happy-melon (talk | contribs)   20:47, 31 March 2011

It should work if you just submit the form again, in the same way as if you try and block a user who is already blocked. Does that not work for you?

#Comment by Bawolff (talk | contribs)   21:31, 31 March 2011

no, it doesn't.

#Comment by Happy-melon (talk | contribs)   23:14, 1 April 2011

Should be fixed in r85166.

#Comment by Aaron Schulz (talk | contribs)   18:51, 18 June 2011
$fields['AlreadyBlocked']['default'] = htmlspecialchars( $block->getTarget() );

What does the htmlspecialchars do here?

#Comment by Werdna (talk | contribs)   17:51, 15 July 2011

The htmlspecialchars are unnecessary.

HTMLForm does its own HTML escaping, unless you specifically specify for it to do otherwise.

#Comment by Happy-melon (talk | contribs)   19:05, 26 July 2011

Removed in r93233.

Status & tagging log

  • 10:34, 11 August 2011 Catrope (talk | contribs) changed the status of r85025 [removed: new added: resolved]
  • 19:05, 26 July 2011 Happy-melon (talk | contribs) changed the status of r85025 [removed: fixme added: new]
  • 17:51, 15 July 2011 Werdna (talk | contribs) changed the status of r85025 [removed: new added: fixme]
  • 23:14, 1 April 2011 Happy-melon (talk | contribs) changed the status of r85025 [removed: fixme added: new]
  • 20:42, 31 March 2011 Bawolff (talk | contribs) changed the status of r85025 [removed: new added: fixme]
  • 20:08, 30 March 2011 Happy-melon (talk | contribs) changed the status of r85025 [removed: fixme added: new]
  • 18:20, 30 March 2011 Nikerabbit (talk | contribs) changed the status of r85025 [removed: new added: fixme]