From b43d6897067dd5790f4cf715d259226f99d1d330 Mon Sep 17 00:00:00 2001 From: messju Date: Sun, 27 Jun 2004 19:37:34 +0000 Subject: [PATCH] fixed escaping of backslashes in Smarty_Compiler::_quote_replace() --- NEWS | 2 ++ libs/Smarty_Compiler.class.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 419ca090..6796b7b4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fix escaping of backslashes in Smarty_Compiler::_quote_replace() (messju) + Version 2.6.3 (June 16, 2004) ----------------------------- diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 77939f81..1a3ea9ac 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -2120,7 +2120,7 @@ class Smarty_Compiler extends Smarty { */ function _quote_replace($string) { - return preg_replace('![\\$]\d!', '\\\\\\0', $string); + return strtr($string, array('\\' => '\\\\', '$' => '\\$')); } /**