summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-01-18 18:21:45 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-01-18 18:21:45 +0000
commit84db078226dd565d90952d842751301920092dcf (patch)
tree2852803ebf01ed864fd3e14ee05d2771ad3031fe /roundcubemail/program
parent0c125826a2252a14209648e384d2f5213d664b85 (diff)
- Use callback function instead of /e modifier in preg_replace()
git-svn-id: https://svn.roundcube.net/trunk@3210 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rwxr-xr-xroundcubemail/program/include/rcube_template.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_template.php b/roundcubemail/program/include/rcube_template.php
index 5226f8db8..fe0d747bb 100755
--- a/roundcubemail/program/include/rcube_template.php
+++ b/roundcubemail/program/include/rcube_template.php
@@ -455,7 +455,16 @@ class rcube_template extends rcube_html_page
{
$GLOBALS['__version'] = Q(RCMAIL_VERSION);
$GLOBALS['__comm_path'] = Q($this->app->comm_path);
- return preg_replace('/\$(__[a-z0-9_\-]+)/e', '$GLOBALS["\\1"]', $input);
+ return preg_replace_callback('/\$(__[a-z0-9_\-]+)/',
+ array($this, 'globals_callback'), $input);
+ }
+
+ /**
+ * Callback funtion for preg_replace_callback() in parse_with_globals()
+ */
+ private function globals_callback($matches)
+ {
+ return $GLOBALS[$matches[1]];
}
/**