Code

Fixed problem with evil XML tags in location name.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Jun 2008 08:38:49 +0000 (08:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Jun 2008 08:38:49 +0000 (08:38 +0000)
Characters like "'<> are not allowed in <location="", remove during in config initialization.

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

gosa-core/include/class_config.inc

index ebb2e73ec0059154773e8e8e767ba1d5817621b4..db862c0f887929ba03f86b9105f767b07d44d86f 100644 (file)
@@ -160,11 +160,13 @@ class config  {
       case 'LOCATION':
                   if ($this->tags[$this->level-2] == 'MAIN'){
                     $name= $attrs['NAME'];
+                    $name = preg_replace("/[<>\"']/","",$name);
+                    $attrs['NAME'] = $name;
                     $this->currentLocation= $name;
 
                     /* Add location elements */
-                      $this->data['LOCATIONS'][$name]= $attrs;
-                    }
+                    $this->data['LOCATIONS'][$name]= $attrs;
+                  }
                   break;
 
                   /* Handle referral tags */
@@ -268,6 +270,7 @@ class config  {
   function set_current($name)
   {
     $this->current= $this->data['LOCATIONS'][$name];
+
     if (!isset($this->current['PEOPLE'])){
       $this->current['PEOPLE']= "ou=people";
     }