From 1fbbb90f97a78530289dfb14614053794327c2b7 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 1 Mar 2008 10:59:44 +0000 Subject: [PATCH] Fixed parameter expansion git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9223 594d385d-05f5-0310-b6e9-bd551577e9d8 --- Changelog | 1 + include/class_plugin.inc | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Changelog b/Changelog index 2a78bfaf7..1b7f95afb 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ GOsa2 changelog * gosa 2.5.16 - ridbase may be undefined in domain objects + - Fixed postremove/-create/-modify parameter expansion * gosa 2.5.15 - Changed order of sys-action commandline parameters diff --git a/include/class_plugin.inc b/include/class_plugin.inc index a6e3da710..f4dd40ef6 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -547,16 +547,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__, @@ -582,16 +582,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__, @@ -617,21 +617,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