From 1fe6ad061c142b72535a42555d4b6ea757bc1116 Mon Sep 17 00:00:00 2001 From: "monte.ohrt" Date: Mon, 22 Sep 2008 19:26:32 +0000 Subject: [PATCH] patch for security, php executed in templates --- libs/Smarty_Compiler.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 42b58aac..29099779 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1705,6 +1705,8 @@ class Smarty_Compiler extends Smarty { } // replace double quoted literal string with single quotes $_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return); + // escape dollar sign if not printing a var + $_return = preg_replace('~\$(\W)~',"\\\\\$\\1",$_return); return $_return; }