From: hickert Date: Mon, 15 Feb 2010 15:12:07 +0000 (+0000) Subject: Updated utils/msgPool X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab639804b15f276943e5d61feb8e584e7d309690;p=gosa.git Updated utils/msgPool -msgPool::invalid is now able to handle regex with special chars git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15627 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/utils/class_msgPool.inc b/gosa-core/include/utils/class_msgPool.inc index 8dea7c25f..d58debb98 100644 --- a/gosa-core/include/utils/class_msgPool.inc +++ b/gosa-core/include/utils/class_msgPool.inc @@ -280,17 +280,20 @@ class msgPool if ($regex) { $result= ""; $mismatch= ""; - foreach (str_split($data) as $currentChar){ + + mb_internal_encoding('UTF-8'); + for($i=0; $i<=mb_strlen($data);$i++){ + $currentChar= mb_substr($data, $i,1); if (preg_match("$regex", $currentChar)){ $result.= $currentChar; } else { - $result.= "".htmlentities($currentChar).""; + $result.= "".($currentChar).""; $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:"), $mismatch):sprintf(_("'%s' are not allowed!"), $mismatch)). "

\"$result\"$example"; } else { return sprintf(_("The Field '%s' contains invalid characters!"), $name)."!$example";