From 661572206c65afd4b58a05ee296ae9a8104054a1 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 5 Dec 2012 18:16:42 +0000 Subject: [PATCH] Allow to specify app in egw::link() pseudo function --- etemplate/inc/class.etemplate_old.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.etemplate_old.inc.php b/etemplate/inc/class.etemplate_old.inc.php index 131d1605f3..02895d58eb 100644 --- a/etemplate/inc/class.etemplate_old.inc.php +++ b/etemplate/inc/class.etemplate_old.inc.php @@ -2102,12 +2102,12 @@ class etemplate_old extends boetemplate { if (strpos($on,'::') !== false) // avoid the expensive regular expresions, for performance reasons { - if (preg_match_all("/egw::link\\('([^']+)','(.+?)'\\)/",$on,$matches)) // the ? alters the expression to shortest match + if (preg_match_all("/egw::link\\('([^']+)','(.+?)'(?:,'(.+?)')?\\)/",$on,$matches)) // the ? alters the expression to shortest match { foreach(array_keys($matches[1]) as $n) // this way we can correctly parse ' in the 2. argument { - $url = $GLOBALS['egw']->link($matches[1][$n],$matches[2][$n]); - $on = str_replace($matches[0][$n],'\''.$url.'\'',$on); + $url = $GLOBALS['egw']->link($matches[1][$n],$matches[2][$n],$matches[3][$n]); + $on = str_replace($matches[0][$n],'\''.addslashes($url).'\'',$on); } }