From: lhm-gosa Date: Thu, 16 Jul 2009 12:55:11 +0000 (+0000) Subject: Fix check of idVendor and idProduct inputfields. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=815f74a3d976aa6f1df8d2b88f81afab5ebd34d4;p=gosa.git Fix check of idVendor and idProduct inputfields. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13932 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc index 0448b3bde..ecd1c3c10 100644 --- a/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc +++ b/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc @@ -100,7 +100,7 @@ class deviceGeneric extends plugin $message[]= msgPool::required(_("iSerial")); } if(empty($this->serial) || !$this->is_2byteHex($this->serial)){ - $message[]= msgPool::invalid(_("Serial"),"","","0x1234"); + $message[]= msgPool::invalid(_("Product ID"),"","","0x1234"); } if(empty($this->vendor) || !$this->is_2byteHex($this->vendor)){ $message[]= msgPool::invalid(_("Vendor ID"),"","","0x1234"); @@ -201,7 +201,7 @@ class deviceGeneric extends plugin /* check if given str in like this 0xffff*/ function is_2byteHex($str) { - return !strlen($str) || preg_match("/^(0x|x|)[a-f0-9][a-f0-9][a-f0-9][a-f0-9]/i",$str); + return !strlen($str) || preg_match("/^(0x|)[a-f0-9]{4}$/i",$str); }