This commit is contained in:
Stefan Becker 2008-04-22 08:42:31 +00:00
parent 1113f2ec1c
commit 82e4a81bc8

View File

@ -1818,10 +1818,13 @@ class etemplate extends boetemplate
{
if (strpos($on,'::') !== false) // avoid the expensive regular expresions, for performance reasons
{
if (preg_match("/egw::link\\('([^']+)','(.+?)'\\)/",$on,$matches)) // the ? alters the expression to shortest match
{ // this way we can correctly parse ' in the 2. argument
$url = $GLOBALS['egw']->link($matches[1],$matches[2]);
$on = str_replace($matches[0],'\''.$url.'\'',$on);
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);
}
}
if (preg_match_all("/form::name\\('([^']+)'\\)/",$on,$matches)) {