Code

Updated setup to use xmlentities
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Apr 2008 12:15:41 +0000 (12:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Apr 2008 12:15:41 +0000 (12:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10213 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc
gosa-core/setup/class_setupStep_Config1.inc
gosa-core/setup/class_setupStep_Config2.inc
gosa-core/setup/class_setupStep_Config3.inc
gosa-core/setup/class_setupStep_Feedback.inc
gosa-core/setup/class_setupStep_Ldap.inc
gosa-core/setup/class_setupStep_Migrate.inc

index 1926e94f04238174a9dcf3c42c867b84d8e1e544..cbcebe94b92bf6d5598d0c744a1a76e71f69e7ea 100644 (file)
@@ -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);
+  }
 }
 
 
index 1087b6a2b18af2da7ebc52cb32659aba184de84c..d418df8639fe6fb9a43d6c8efc1e2e4746dc3f99 100644 (file)
@@ -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, 
index 450fe81e1c20c6ef30dbb700f57526944166cfba..97a5c02e8c5a2ef58df93fd662936eb505c8a60f 100644 (file)
@@ -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);
index cd62785e3b9c751505cbdb0797a924b07612a27e..7712c705506bc98628cf67cefc6454438d673fe9 100644 (file)
@@ -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")));
index cf89cf6d2e0ef59bd43f9830bb9a4c029e0db7fa..0863e1fd0d413b977184bcc3a195dd5a0d2c16bc 100644 (file)
@@ -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);
index e831ec1055f6fbf57d52cfe65db249dcfea652a0..855a4a8d35800ea1e97314b7fd440a36360087a4 100644 (file)
@@ -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")));
index 7e45ca33e28fff923493f83bb731d1d925d16bbc..cec90017e36f65a445f076e5711699bdda8aee76 100644 (file)
@@ -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);