From: Happy-melon Date: Sat, 12 Mar 2011 23:54:32 +0000 (+0000) Subject: (bug 28017) Unblocking a user with a space in their name does not work. This fix... X-Git-Tag: 1.31.0-rc.0~31484 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=ca3310f2bce7b4a84284c3ad6395c5c66d71825b;p=lhc%2Fweb%2Fwiklou.git (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... --- diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index 18f15d1de3..81c4643a06 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -211,6 +211,9 @@ class IPUnblockForm extends SpecialPage { } $ip = $block->getRedactedName(); } else { + # FIXME: do proper sanitisation/cleanup here + $ip = str_replace( '_', ' ', $ip ); + $block = Block::newFromDB( $ip ); if ( !$block ) { return array( 'ipb_cant_unblock', htmlspecialchars( $id ) );