From 4e4526b47b8ec7d9b8ec8aa76f526e2e375c25e4 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 1 Mar 2008 11:07:37 +0000 Subject: [PATCH] Fixed post scripts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9224 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_plugin.inc | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 89642ff57..6bf6e73db 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -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__, -- 2.30.2