From: hickert Date: Wed, 18 Jun 2008 08:41:17 +0000 (+0000) Subject: Fixed Setup, allow passwords with '" without breaking to setup ui. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a2b85ae2ff9c0e3ba37142aa5292cb801653c46f;p=gosa.git Fixed Setup, allow passwords with '" without breaking to setup ui. Fixed problem with unusable configuration file, xml tags are now replaced correctly. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11353 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 62ca20be9..ab153dd0a 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2715,7 +2715,22 @@ function send_binary_content($data,$name,$type = "application/octet-stream") function xmlentities($str) { if(is_string($str)){ - return(htmlentities($str,ENT_QUOTES)); + + static $asc2uni= array(); + if (!count($asc2uni)){ + for($i=128;$i<256;$i++){ + # $asc2uni[chr($i)] = "&#x".dechex($i).";"; + } + } + + $str = str_replace("&", "&", $str); + $str = str_replace("<", "<", $str); + $str = str_replace(">", ">", $str); + $str = str_replace("'", "'", $str); + $str = str_replace("\"", """, $str); + $str = str_replace("\r", "", $str); + $str = strtr($str,$asc2uni); + return $str; }elseif(is_array($str)){ foreach($str as $name => $value){ $str[$name] = xmlentities($value); diff --git a/gosa-core/setup/class_setupStep_Ldap.inc b/gosa-core/setup/class_setupStep_Ldap.inc index e831ec105..a590a3bf0 100644 --- a/gosa-core/setup/class_setupStep_Ldap.inc +++ b/gosa-core/setup/class_setupStep_Ldap.inc @@ -60,7 +60,7 @@ class Step_Ldap extends setup_step { $smarty = get_smarty(); foreach($this->attributes as $attr){ - $smarty->assign($attr,$this->$attr); + $smarty->assign($attr,htmlentities($this->$attr,ENT_QUOTES,"UTF-8")); } /* Assign connection status */