From d93a4f84cdd2b9252707693eee3b04e656463a04 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 17 Oct 2010 13:36:24 +0000 Subject: [PATCH] improved script server check --- lam/lib/config.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index a33bb191..8aa43fa9 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -746,7 +746,7 @@ class LAMConfig { $ip = $arr_value; $servername = ""; } - if (isset($ip) && is_string($ip) && preg_match("/^[a-z0-9-]+(\\.[a-z0-9-]+)*$/i", $ip)) { + if (isset($ip) && is_string($ip) && preg_match("/^[a-z0-9-]+(\\.[a-z0-9-]+)*(,[0-9]+)?$/i", $ip)) { // Check if the IP has a server name if (!empty($servername)) { $valid_ips[] = $servername.":".$ip; @@ -755,6 +755,10 @@ class LAMConfig { $valid_ips[] = $ip; } } + else { + // wrong format + return false; + } } // Check that the array is not empty if ($array_string > 0) {