From: Ævar Arnfjörð Bjarmason Date: Thu, 28 Apr 2005 03:07:41 +0000 (+0000) Subject: * Documented isIP and added a correct regexp as a comment. X-Git-Tag: 1.5.0alpha1~96 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=bb12b3acc260b338c2c419ba7d18b88289adc77b;p=lhc%2Fweb%2Fwiklou.git * Documented isIP and added a correct regexp as a comment. --- diff --git a/includes/User.php b/includes/User.php index 8ad9ae2ee0..da07a23a73 100644 --- a/includes/User.php +++ b/includes/User.php @@ -133,12 +133,20 @@ class User { } /** - * does the string match an anonymous user IP address? - * @param string $name Nickname of a user + * does the string match an anonymous IPv4 address? + * * @static + * @param string $name Nickname of a user + * @return bool */ function isIP( $name ) { return preg_match("/^\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3}$/",$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);*/ } /**