X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FIP.php;h=5c50c22f440866168d54da361c368ab4e108c8af;hb=6e63a509ebaef1259e779da6b421c418955b1cdd;hp=1b40f4bc1abd6257c7a74daea101d80a88d7b8e5;hpb=512a8b7374fa7d8200aef180667996b105b0e79f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/IP.php b/includes/IP.php index 1b40f4bc1a..5c50c22f44 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -714,7 +714,9 @@ 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) + // remove zone info (bug 35738) + $addr = preg_replace( '/\%.*/', '', $addr ); + if ( self::isValid( $addr ) ) { return $addr; }