index 74a7183e59187bc7524da99b304ae6c566148ec6..fc55c61d73bbc67e2f7765b787c92accb2f5b258 100644 (file)
$message[]= _("The required field 'IP-address' is not set.");
}
$message[]= _("The required field 'IP-address' is not set.");
}
- /* check if given ip is valid ipi
- */
- $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
- if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->ipHostNumber)){
- $message[]= _("Wrong IP format in field IP-address.");
- }
+ }
+
+ /* check if given ip is valid ip */
+ if ($this->ipHostNumber != "" && !is_ip($this->ipHostNumber)){
+ $message[]= _("Wrong IP format in field IP-address.");
}
/* Check if mac is empty
}
/* Check if mac is empty
/* Check if given mac is valid mac
*/
/* Check if given mac is valid mac
*/
- $tr = count(split(":",$this->macAddress));
- if($tr!=6){
+ if(!is_mac($this->macAddress)){
$message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'."));
}
$message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'."));
}