mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +02:00
patch for security, php executed in templates
This commit is contained in:
@@ -1705,6 +1705,8 @@ class Smarty_Compiler extends Smarty {
|
|||||||
}
|
}
|
||||||
// replace double quoted literal string with single quotes
|
// replace double quoted literal string with single quotes
|
||||||
$_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return);
|
$_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return);
|
||||||
|
// escape dollar sign if not printing a var
|
||||||
|
$_return = preg_replace('~\$(\W)~',"\\\\\$\\1",$_return);
|
||||||
return $_return;
|
return $_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user