r36441 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36440‎ | r36441 | r36442 >
Date:06:14, 19 June 2008
Author:aaron
Status:old
Tags:
Comment:
Loosen ipv4 check back, this really should be called isLikeIP()
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -431,13 +431,7 @@
432432 * @return bool
433433 */
434434 static function isIP( $name ) {
435 - return IP::isIPAddress($name);
436 - /*return preg_match("/^
437 - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
438 - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
439 - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
440 - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))
441 - $/x", $name);*/
 435+ return preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.(?:xxx|\d{1,3})$/',$name) || IP::isIPv6($name);
442436 }
443437
444438 /**

Status & tagging log