From: Aaron Schulz Date: Thu, 19 Jun 2008 06:14:53 +0000 (+0000) Subject: Loosen ipv4 check back, this really should be called isLikeIP() X-Git-Tag: 1.31.0-rc.0~46956 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=commitdiff_plain;h=8bd6a73d4051762e81850cf2815244f5b1fb8251;p=lhc%2Fweb%2Fwiklou.git Loosen ipv4 check back, this really should be called isLikeIP() --- diff --git a/includes/User.php b/includes/User.php index 6d8c739499..0f6e797bf4 100644 --- a/includes/User.php +++ b/includes/User.php @@ -431,13 +431,7 @@ class User { * @return bool */ static function isIP( $name ) { - return IP::isIPAddress($name); - /*return preg_match("/^ - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\. - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\. - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\. - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5])) - $/x", $name);*/ + return preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.(?:xxx|\d{1,3})$/',$name) || IP::isIPv6($name); } /**