From bbe4890b89d72060d0fa8d19e5537d3b29753527 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Tue, 16 Jul 2013 19:46:59 +0000 Subject: [PATCH] * Fixed made Smarty_Compiler.class.php compatible with PHP 5.5 --- ChangeLog | 5 +++++ libs/Smarty_Compiler.class.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55da923a..8e29f609 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-07-16 Uwe Tews + + * Fixed made Smarty_Compiler.class.php compatible with PHP 5.5 + + 2012-09-24 Uwe Tews * Fixed escape Smarty error messages to avoid possible script execution diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 791ec72c..686fe65a 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -262,11 +262,11 @@ class Smarty_Compiler extends Smarty { reset($this->_folded_blocks); /* replace special blocks by "{php}" */ - $source_content = preg_replace($search.'e', "'" + $source_content = preg_replace_callback($search, create_function ('$matches', "return '" . $this->_quote_replace($this->left_delimiter) . 'php' - . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'" + . "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'" . $this->_quote_replace($this->right_delimiter) - . "'" + . "';") , $source_content); /* Gather all template tags. */