From: hickert Date: Fri, 24 Oct 2008 14:47:25 +0000 (+0000) Subject: Updated gofon macro parsing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5607b324732640eef760b759fe9016ea610dd218;p=gosa.git 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 --- 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."'),"; }