From: psc Date: Tue, 7 Sep 2010 09:07:16 +0000 (+0000) Subject: Apply fix for #3105 X-Git-Url: https://git.tokkee.org/?p=gosa.git;a=commitdiff_plain;h=835105e09ef8fa2c0d59602ae3d99098c3421fe1 Apply fix for #3105 Properly transcode special invalid characters in the 'invalid' stock error message, fix an additonal exclamation mark when additionally example input is presented and use already translated field names for Product-ID and Vendor-ID in the hotplug management. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19543 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-core/include/utils/class_msgPool.inc b/trunk/gosa-core/include/utils/class_msgPool.inc index 0111b6f48..af83edf03 100644 --- a/trunk/gosa-core/include/utils/class_msgPool.inc +++ b/trunk/gosa-core/include/utils/class_msgPool.inc @@ -284,20 +284,20 @@ class msgPool if ($regex) { $result= ""; $mismatch= ""; - foreach (str_split($data) as $currentChar){ + foreach (preg_split("//u", $data) as $currentChar){ if (preg_match("$regex", $currentChar)){ $result.= $currentChar; } else { - $result.= "".htmlentities($currentChar).""; + $result.= "".htmlentities($currentChar, ENT_COMPAT, "UTF-8").""; $mismatch.= $currentChar; } } return sprintf(_("The Field '%s' contains invalid characters"), $name).". ". - (strlen($mismatch)==1?sprintf(_("'%s' is not allowed:"), htmlentities($mismatch)):sprintf(_("'%s' are not allowed!"), htmlentities($mismatch))). + (strlen($mismatch)==1?sprintf(_("'%s' is not allowed:"), htmlentities($mismatch, ENT_COMPAT, "UTF-8")):sprintf(_("'%s' are not allowed!"), htmlentities($mismatch, ENT_COMPAT, "UTF-8"))). "

\"$result\"$example"; } else { - return sprintf(_("The Field '%s' contains invalid characters!"), $name)."!$example"; + return sprintf(_("The Field '%s' contains invalid characters!"), $name)."$example"; } } diff --git a/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc index b8b91e2cc..d4d5043ca 100644 --- a/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc +++ b/trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc @@ -100,10 +100,10 @@ class deviceGeneric extends plugin $message[]= msgPool::required(_("iSerial")); } if(empty($this->serial) || !$this->is_2byteHex($this->serial)){ - $message[]= msgPool::invalid(_("Product ID"),"","","0x1234"); + $message[]= msgPool::invalid(_("Product-ID"),"","","0x1234"); } if(empty($this->vendor) || !$this->is_2byteHex($this->vendor)){ - $message[]= msgPool::invalid(_("Vendor ID"),"","","0x1234"); + $message[]= msgPool::invalid(_("Vendor-ID"),"","","0x1234"); } /* Convert vendorId and productId to lower case */ $this->serial = strtolower($this->serial);