[Bug 35738] remove zone info from ipv6 addresses
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 5 Sep 2012 19:11:42 +0000 (21:11 +0200)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 6 Sep 2012 05:22:40 +0000 (22:22 -0700)
Patch provided by Nick Kuznia

Change-Id: Icccf10974746e8e27000ab45de28d0f1836ec8aa

includes/IP.php

index 1828249..10c707e 100644 (file)
@@ -714,6 +714,7 @@ class IP {
         * @return String: valid dotted quad IPv4 address or null
         */
        public static function canonicalize( $addr ) {
+               $addr = preg_replace( '/\%.*/','', $addr ); // remove zone info (bug 35738)
                if ( self::isValid( $addr ) ) {
                        return $addr;
                }