From bb12b3acc260b338c2c419ba7d18b88289adc77b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 28 Apr 2005 03:07:41 +0000 Subject: [PATCH] * Documented isIP and added a correct regexp as a comment. --- includes/User.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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);*/ } /** -- 2.20.1