From: Nico Kaiser Date: Fri, 2 Aug 2013 17:04:19 +0000 (+0200) Subject: Use preg_match instead of eregi. Fixes #1 X-Git-Tag: v1.0.0~7 X-Git-Url: http://git.neszt.hu/?a=commitdiff_plain;h=c5f9c94beed98f4b451497b8ad6b6503c17c8092;p=Dyndns%2F.git Use preg_match instead of eregi. Fixes #1 --- diff --git a/web/lib/Dyndns/Helper.php b/web/lib/Dyndns/Helper.php index 9e74115..26068ec 100644 --- a/web/lib/Dyndns/Helper.php +++ b/web/lib/Dyndns/Helper.php @@ -18,7 +18,7 @@ class Helper */ public static function checkValidIp($ip) { - if (! eregi("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$", $ip)) + if (! preg_match("/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) return false; $tmp = explode(".", $ip); @@ -38,7 +38,7 @@ class Helper */ public static function checkValidHost($hostname) { - return eregi('^[a-z0-9.-]+$', $hostname); + return preg_match('/^[a-z0-9.-]+$/', $hostname); } /**