improved script server check

This commit is contained in:
Roland Gruber 2010-10-17 13:36:24 +00:00
parent 6d5185ecc2
commit d93a4f84cd
1 changed files with 5 additions and 1 deletions

View File

@ -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) {