Code

Fix check of idVendor and idProduct inputfields.
authorlhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Jul 2009 12:55:11 +0000 (12:55 +0000)
committerlhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Jul 2009 12:55:11 +0000 (12:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13932 594d385d-05f5-0310-b6e9-bd551577e9d8

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);
   }