diff options
author | alecpl <alec@alec.pl> | 2010-01-18 18:21:45 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-01-18 18:21:45 +0000 |
commit | 5740c0670047da260cb91107068d7f7635faaca1 (patch) | |
tree | d1edd905755498ec50f72b0783819832419e7c18 | |
parent | 96b679d10ddedf97c7a72724697edca2f5266179 (diff) |
- Use callback function instead of /e modifier in preg_replace()
-rwxr-xr-x | program/include/rcube_template.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 5226f8db8..fe0d747bb 100755 --- a/program/include/rcube_template.php +++ b/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]]; } /** |