From c5f9c94beed98f4b451497b8ad6b6503c17c8092 Mon Sep 17 00:00:00 2001 From: Nico Kaiser Date: Fri, 2 Aug 2013 19:04:19 +0200 Subject: [PATCH] Use preg_match instead of eregi. Fixes #1 --- web/lib/Dyndns/Helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } /** -- 2.1.4