From: Aaron Schulz Date: Wed, 14 Mar 2007 17:45:41 +0000 (+0000) Subject: *Re-add some things lost in merge X-Git-Tag: 1.31.0-rc.0~53734 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=e8f0ddcdb4504ec28b9c566a33c8127a9db20f8b;p=lhc%2Fweb%2Fwiklou.git *Re-add some things lost in merge --- diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 97ac77f510..6ed5468d9f 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -209,6 +209,8 @@ class IPBlockForm { $this->showLogFragment( $wgOut, $user->getUserPage() ); } elseif( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $this->BlockAddress ) ) { $this->showLogFragment( $wgOut, Title::makeTitle( NS_USER, $this->BlockAddress ) ); + } elseif( preg_match( '/^\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}/', $this->BlockAddress ) ) { + $this->showLogFragment( $wgOut, Title::makeTitle( NS_USER, $this->BlockAddress ) ); } } @@ -216,12 +218,9 @@ class IPBlockForm { global $wgOut, $wgUser, $wgSysopUserBans, $wgSysopRangeBans; $userId = 0; - $this->BlockAddress = trim( $this->BlockAddress ); - # Expand valid IPv6 addresses - if ( IP::isIPv6( $this->BlockAddress ) ) { - $this->BlockAddress = IP::expandIP( $this->BlockAddress ); - } - # The above validation is good enough that those below will suffice from here + # Expand valid IPv6 addresses, usernames are left as is + $this->BlockAddress = IP::sanitizeIP( $this->BlockAddress ); + # isIPv4() and IPv6() are used for final validation $rxIP4 = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; $rxIP6 = '\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}'; $rxIP = "($rxIP4|$rxIP6)";