From: Brion Vibber Date: Wed, 12 Jul 2006 01:29:16 +0000 (+0000) Subject: * (bug 6635) Fix regression searching for range blocks on Ipblocklist X-Git-Tag: 1.31.0-rc.0~56284 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=b2bfdbb6cfc32205c54ec585fbb25ef559d8aaaa;p=lhc%2Fweb%2Fwiklou.git * (bug 6635) Fix regression searching for range blocks on Ipblocklist * Fix regression searching Ipblocklist with ugly URLs It would probably be even nicer if the search for a specific IP would bring up matching range blocks --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8f50cf9b01..bb798fc6e6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -55,6 +55,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Pre-strip characters ignored in IDNs from URLs so they can't be used to break the blacklists for regular URLs * Fix regression in blocking of user accounts +* (bug 6635) Fix regression searching for range blocks on Ipblocklist +* Fix regression searching Ipblocklist with ugly URLs == Languages updated == diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index b1cf1f4ea0..16edc6ce78 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -174,10 +174,17 @@ class IPUnblockForm { } elseif ( wfIP2Unsigned( $this->ip ) !== false ) { $conds['ipb_address'] = $this->ip; $conds['ipb_auto'] = 0; + } elseif( preg_match( "/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/", $this->ip, $matches ) ) { + $conds['ipb_address'] = Block::normaliseRange( $this->ip ); + $conds['ipb_auto'] = 0; } else { $user = User::newFromName( $this->ip ); - if ( ( $id = $user->getID() ) != 0 ) { + if ( $user && ( $id = $user->getID() ) != 0 ) { $conds['ipb_user'] = $id; + } else { + // Uh...? + $conds['ipb_address'] = $this->ip; + $conds['ipb_auto'] = 0; } } @@ -196,11 +203,12 @@ class IPUnblockForm { } function searchForm() { - global $wgTitle, $wgRequest; + global $wgTitle, $wgScript, $wgRequest; return wfElement( 'form', array( - 'action' => $wgTitle->getLocalUrl() ), + 'action' => $wgScript ), null ) . + wfHidden( 'title', $wgTitle->getPrefixedDbKey() ) . wfElement( 'input', array( 'type' => 'hidden', 'name' => 'action',