From 5f12a8d1f379047d2c73fdea70829351d44bd588 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 22 Dec 2006 11:54:44 +0000 Subject: [PATCH] Avoid Syntax errors when using '" in macro git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5461 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/macro/class_gofonMacro.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 67221de02..abfd539bd 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -217,12 +217,12 @@ class macro extends plugin } /* Create query string */ - $context = "macro-".$this->cn; + $context = addslashes("macro-".$this->cn); /* Remove current macro from each server available */ if($save){ foreach($this->goFonHomeServers as $dn => $Server){ - $query = "DELETE FROM ".$Server['EXT_TABLE']." WHERE context= '".$context."';"; + $query = "DELETE FROM ".$Server['EXT_TABLE']." WHERE context='".$context."';"; $r_current = @mysql_pconnect($Server['SERVER'],$Server['LOGIN'],$Server['PASSWORD']); $db_current = @mysql_select_db($Server['DB'],$r_current); $res = @mysql_query($query,$r_current); @@ -313,10 +313,10 @@ class macro extends plugin * and add this line to an array that will be inserted * to each database. */ - $exten = $tmp[0]; - $prio = $tmp[1]; - $app = preg_replace("/\(.*\).*$/","",$tmp[2]); - $para = preg_replace("/^.*\(/","",$tmp[2]); + $exten = addslashes($tmp[0]); + $prio = addslashes($tmp[1]); + $app = addslashes(preg_replace("/\(.*\).*$/","",$tmp[2])); + $para = addslashes(preg_replace("/^.*\(/","",$tmp[2])); $para = preg_replace("/\).*$/","",$para); $sql.= " ('".$context."','".$exten."','".$prio."','".$app."','".$para."'),"; } @@ -454,7 +454,7 @@ class macro extends plugin /* Try to add entries to databases */ $str = $this->add_to_database(true); if($str){ - print_a($str); + print_red($str); }else{ /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); -- 2.30.2