Code

Fixed problem with escaped characters in property values.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 13:48:16 +0000 (13:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 13:48:16 +0000 (13:48 +0000)
-After passing values to smarty, the escaped characters weren't escaped anymore

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18374 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/addons/configViewer/class_commandVerifier.inc
gosa-core/plugins/addons/configViewer/class_configViewer.inc

index 9de87961358014a677b5921c300012ce6d600458..3ddcd86f73a9d991e2be8dd9c4e6a5cd0dbe8e33 100644 (file)
@@ -64,9 +64,9 @@ class commandVerifier
         return($smarty->fetch(get_template_path('commandVerifier.tpl', 'TRUE')));
     }
 
-function save_object()
-{
-    if(isset($_POST['command'])) $this->command = get_post('command');
+    function save_object()
+    {
+        if(isset($_POST['command'])) $this->command = get_post('command');
     }
 
     function save()
index f4a5584b63b152f4994b3b9806487ed44e0f5f3f..02d3b73f8de8869e1ac3ad36815f39d5ba17ebef 100644 (file)
@@ -147,6 +147,10 @@ class configViewer extends management
         $isize  = "200px";
         $name  = "{$class[0]}:{$cn[0]}";
         $value = htmlentities($value[0],ENT_COMPAT,'UTF-8');
+
+        // Add slashes to keep escaped values escaped after passing them to smarty.
+        $value = addslashes($value);
+
         switch($type[0]){
             case 'bool':
                 $res = "<select size=1 name=\"{$name}\" style='width:{$ssize}'>";