From 5607b324732640eef760b759fe9016ea610dd218 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 24 Oct 2008 14:47:25 +0000 Subject: [PATCH] Updated gofon macro parsing -Allow multiple brackets in macro apps. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@12773 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/macro/class_gofonMacro.inc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 9ea248a00..6c273b53e 100644 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -293,14 +293,6 @@ class macro extends plugin if(substr_count($s_linestr,")") >1 ){ return(sprintf(_("More than one ')' is currently not supported. Line : '%s'."),$i_linenum)); } - /* Check if there is an application given */ - if(empty($tmp[1])){ - return(sprintf(_("There is no application given in line : '%s'."),$i_linenum)); - } - /* Check if there is an extension given */ - if(empty($tmp[0])){ - return(sprintf(_("There is no extension type given in line : '%s'."),$i_linenum)); - } /* Create extension entry for current line * and add this line to an array that will be inserted @@ -309,8 +301,7 @@ class macro extends plugin $exten = addslashes($tmp[0]); $prio = addslashes($tmp[1]); $app = addslashes(preg_replace("/\(.*\).*$/","",$tmp[2])); - $para = addslashes(preg_replace("/^.*\(/","",$tmp[2])); - $para = preg_replace("/\).*$/","",$para); + $para = addslashes(preg_replace("/^[^(]*\((.*)\)[^)]*$/", "$1", $tmp[2])); $sql.= " ('".$context."','".$exten."','".$prio."','".$app."','".$para."'),"; } -- 2.30.2