Code

Fix encoding of base
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Jan 2010 07:44:40 +0000 (07:44 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Jan 2010 07:44:40 +0000 (07:44 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15271 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index 2ac0c8e4fec2d2b977406138aa6641672d48a057..651e37f9eb6ed6e8be97afadb15222258dd3c9e7 100644 (file)
@@ -486,7 +486,7 @@ class listing {
 
     // Save base
     if (isset($_POST['BASE']) && $this->baseMode) {
-      $base= get_post('BASE');
+      $base= base64_decode(get_post('BASE'));
       if (isset($this->bases[$base])) {
         $this->base= $base;
         session::global_set("CurrentMainBase", $this->base);
@@ -668,7 +668,6 @@ class listing {
     $result= "<select name='BASE' onChange='mainform.submit()' size='1'>";
     $firstDN= null;
     $found= false;
-
     foreach ($this->bases as $key=>$value) {
       // Keep first entry to fall back eventually
       if(!$firstDN) {
@@ -681,8 +680,8 @@ class listing {
         $selected= " selected";
         $found= true;
       }
-      $key = htmlentities($key,ENT_QUOTES);
-      $result.= "\n<option value=\"".$key."\"$selected>".$value."</option>";
+      // Encode key in b64 to avoid strange characters
+      $result.= "\n<option value=\"".base64_encode($key)."\"$selected>".$value."</option>";
     }
 
     $result.= "</select>";