Code

Fixed post scripts
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 1 Mar 2008 11:07:37 +0000 (11:07 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 1 Mar 2008 11:07:37 +0000 (11:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9224 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_plugin.inc

index 89642ff57d9b66df0757447e42d714e02fd5ad27..6bf6e73db4e49045c1238a3bc59a5fc83284e539 100644 (file)
@@ -601,16 +601,16 @@ class plugin
 
       /* Additional attributes */
       foreach ($add_attrs as $name => $value){
-        $command= preg_replace("/%$name/", $value, $command);
+        $command= preg_replace("/%$name( |$)/", "$value ", $command);
       }
 
       /* Walk through attribute list */
       foreach ($this->attributes as $attr){
         if (!is_array($this->$attr)){
-          $command= preg_replace("/%$attr/", $this->$attr, $command);
+          $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
         }
       }
-      $command= preg_replace("/%dn/", $this->dn, $command);
+      $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
 
       if (check_command($command)){
         @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
@@ -633,16 +633,16 @@ class plugin
 
       /* Additional attributes */
       foreach ($add_attrs as $name => $value){
-        $command= preg_replace("/%$name/", $value, $command);
+        $command= preg_replace("/%$name( |$)/", "$value ", $command);
       }
 
       /* Walk through attribute list */
       foreach ($this->attributes as $attr){
         if (!is_array($this->$attr)){
-          $command= preg_replace("/%$attr/", $this->$attr, $command);
+          $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
         }
       }
-      $command= preg_replace("/%dn/", $this->dn, $command);
+      $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
 
       if (check_command($command)){
         @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
@@ -664,21 +664,16 @@ class plugin
 
       /* Additional attributes */
       foreach ($add_attrs as $name => $value){
-        $command= preg_replace("/%$name/", $value, $command);
+        $command= preg_replace("/%$name( |$)/", "$value ", $command);
       }
 
       /* Walk through attribute list */
       foreach ($this->attributes as $attr){
         if (!is_array($this->$attr)){
-          $command= preg_replace("/%$attr/", $this->$attr, $command);
+          $command= preg_replace("/%$attr( |$)/", $this->$attr." ", $command);
         }
       }
-      $command= preg_replace("/%dn/", $this->dn, $command);
-
-      /* Additional attributes */
-      foreach ($add_attrs as $name => $value){
-        $command= preg_replace("/%$name/", $value, $command);
-      }
+      $command= preg_replace("/%dn( |$)/", $this->dn." ", $command);
 
       if (check_command($command)){
         @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,