summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9893395)
raw | patch | inline | side by side (parent: 9893395)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 09:07:16 +0000 (09:07 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 09:07:16 +0000 (09:07 +0000) |
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
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
trunk/gosa-core/include/utils/class_msgPool.inc | patch | blob | history | |
trunk/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc | patch | blob | history |
diff --git a/trunk/gosa-core/include/utils/class_msgPool.inc b/trunk/gosa-core/include/utils/class_msgPool.inc
index 0111b6f4829787585fe7625e4e5254ec55ccd856..af83edf03fc4563dc62c89680553950840600443 100644 (file)
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.= "<font style='color:red;text-decoration:underline;'>".htmlentities($currentChar)."</font>";
+ $result.= "<font style='color:red;text-decoration:underline;'>".htmlentities($currentChar, ENT_COMPAT, "UTF-8")."</font>";
$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"))).
"<br><br> \"$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 b8b91e2ccc2f94b2d0f734980dd1bcd9addaaf8b..d4d5043cae7c2040b2abd65134ad9782fd7fc7ec 100644 (file)
$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);