From: hickert Date: Fri, 4 Apr 2008 12:15:41 +0000 (+0000) Subject: Updated setup to use xmlentities X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=24187cd7f31d0214f0e97b5f79b3026a67119dd5;p=gosa.git Updated setup to use xmlentities git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10213 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 1926e94f0..cbcebe94b 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2673,8 +2673,12 @@ function send_binary_content($data,$name,$type = "application/octet-stream") @return The encoded String */ function xmlentities($str) -{ - return (htmlentities($str,ENT_QUOTES)); +{ + if(is_string($str)){ + return(htmlentities($str,ENT_QUOTES)); + }else{ + return($str); + } } diff --git a/gosa-core/setup/class_setupStep_Config1.inc b/gosa-core/setup/class_setupStep_Config1.inc index 1087b6a2b..d418df863 100644 --- a/gosa-core/setup/class_setupStep_Config1.inc +++ b/gosa-core/setup/class_setupStep_Config1.inc @@ -87,7 +87,7 @@ class Step_Config1 extends setup_step $smarty->assign("pwd_rules",$this->pwd_rules); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ - $smarty->assign($attr,$this->$attr); + $smarty->assign($attr,xmlentities($this->$attr)); } /* !!! Attention strict is inverse. If you change this, diff --git a/gosa-core/setup/class_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc index 450fe81e1..97a5c02e8 100644 --- a/gosa-core/setup/class_setupStep_Config2.inc +++ b/gosa-core/setup/class_setupStep_Config2.inc @@ -161,7 +161,7 @@ class Step_Config2 extends setup_step $smarty->assign("samba_settings",$this->samba_settings); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ - $smarty->assign($attr,$this->$attr); + $smarty->assign($attr,xmlentities($this->$attr)); } $smarty->assign("timezone" ,$this->timezone); $smarty->assign("timezones" ,$this->timezones); diff --git a/gosa-core/setup/class_setupStep_Config3.inc b/gosa-core/setup/class_setupStep_Config3.inc index cd62785e3..7712c7055 100644 --- a/gosa-core/setup/class_setupStep_Config3.inc +++ b/gosa-core/setup/class_setupStep_Config3.inc @@ -93,7 +93,7 @@ class Step_Config3 extends setup_step $smarty->assign("optional", $this->optional); foreach($this->attributes as $attr){ - $smarty->assign($attr,$this->$attr); + $smarty->assign($attr,xmlentities($this->$attr)); } $smarty->assign("login_attributes",$this->login_attributes); return($smarty -> fetch (get_template_path("../setup/setup_config3.tpl"))); diff --git a/gosa-core/setup/class_setupStep_Feedback.inc b/gosa-core/setup/class_setupStep_Feedback.inc index cf89cf6d2..0863e1fd0 100644 --- a/gosa-core/setup/class_setupStep_Feedback.inc +++ b/gosa-core/setup/class_setupStep_Feedback.inc @@ -164,7 +164,7 @@ class Step_Feedback extends setup_step $smarty = get_smarty(); foreach($this->attributes as $attr){ - $smarty->assign($attr, $this->$attr); + $smarty->assign($attr, xmlentities($this->$attr)); } $smarty->assign("years",$years); $smarty->assign("features_used",$this->features_used); diff --git a/gosa-core/setup/class_setupStep_Ldap.inc b/gosa-core/setup/class_setupStep_Ldap.inc index e831ec105..855a4a8d3 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,xmlentities($this->$attr)); } /* Assign connection status */ @@ -84,7 +84,7 @@ class Step_Ldap extends setup_step $base_to_append = $this->base; if(strlen($base_to_append) > 20){ - $base_to_append = substr($base_to_append,0,17)."..."; + $base_to_append = xmlentities(substr($base_to_append,0,17)."..."); } $smarty->assign("base_to_append",$base_to_append); return($smarty -> fetch (get_template_path("../setup/setup_ldap.tpl"))); diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc index 7e45ca33e..cec90017e 100644 --- a/gosa-core/setup/class_setupStep_Migrate.inc +++ b/gosa-core/setup/class_setupStep_Migrate.inc @@ -1407,9 +1407,9 @@ class Step_Migrate extends setup_step $uid = $_POST['new_user_uid']; } - $smarty->assign("new_user_uid",$uid); - $smarty->assign("new_user_password",@$_POST['new_user_password']); - $smarty->assign("new_user_password2",@$_POST['new_user_password2']); + $smarty->assign("new_user_uid", xmlentities($uid)); + $smarty->assign("new_user_password",xmlentities(@$_POST['new_user_password'])); + $smarty->assign("new_user_password2",xmlentities(@$_POST['new_user_password2'])); $smarty->assign("method","create_acls"); $smarty->assign("acl_create_selected",$this->acl_create_selected); $smarty->assign("what_will_be_done_now",$this->acl_create_changes);