Use preg_match instead of eregi. Fixes #1
authorNico Kaiser <nico@kaiser.me>
Fri, 2 Aug 2013 17:04:19 +0000 (19:04 +0200)
committerNico Kaiser <nico@kaiser.me>
Fri, 2 Aug 2013 17:04:19 +0000 (19:04 +0200)
web/lib/Dyndns/Helper.php

index 9e74115..26068ec 100644 (file)
@@ -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);
     }
 
     /**