From b2bfdbb6cfc32205c54ec585fbb25ef559d8aaaa Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 12 Jul 2006 01:29:16 +0000 Subject: [PATCH] * (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 --- RELEASE-NOTES | 2 ++ includes/SpecialIpblocklist.php | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) 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', -- 2.20.1