r83798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83797‎ | r83798 | r83799 >
Date:23:54, 12 March 2011
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
(bug 28017) Unblocking a user with a space in their name does not work. This fix is no more ghastly than the rest of the code in the file; the whole thing (as usual) needs a complete rewrite...
Modified paths:
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -211,6 +211,9 @@
212212 }
213213 $ip = $block->getRedactedName();
214214 } else {
 215+ # FIXME: do proper sanitisation/cleanup here
 216+ $ip = str_replace( '_', ' ', $ip );
 217+
215218 $block = Block::newFromDB( $ip );
216219 if ( !$block ) {
217220 return array( 'ipb_cant_unblock', htmlspecialchars( $id ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r852561.17wmf1: MFT r80813, r80815, r83798, r84459, r84729, r84820, r84921, r84985,...catrope14:13, 3 April 2011
r85354MFT r82518, r82530, r82538, r82547, r82550, r82565, r82572, r82608, r82696, r...demon18:25, 4 April 2011

Comments

#Comment by Bawolff (talk | contribs)   15:13, 15 March 2011

This probably also misses if the first letter isn't capitalized.

How about something like

$name = User::newFromName($ip);
if ($ip) {
  // its a user not an ip.
  $ip = $name->getName();
}

Not sure if this still applies, since I noticed you did a lot of work on the blocking system recently.

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

It doesn't still apply; there's sod all left of this code in SpecialBloclist.php now. This is/was just a quick hack to fix an issue people were actively moaning about.

Status & tagging log