Code

Fix check of idVendor and idProduct inputfields.
[gosa.git] / trunk / gosa-plugins / goto / admin / devices / class_deviceGeneric.inc
index 0448b3bde477c104852c65bfc142a2dcb5f575ea..ecd1c3c1018357b8808a2666db077dd9aaccf8be 100644 (file)
@@ -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);
   }