mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
add appropriate warnings when passing array as extra parameter
This commit is contained in:
@@ -6,10 +6,12 @@
|
||||
special chars except for already escaped ones
|
||||
\*======================================================================*/
|
||||
function smarty_function_escape_special_chars($string)
|
||||
{
|
||||
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
|
||||
$string = htmlspecialchars($string);
|
||||
$string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
|
||||
{
|
||||
if(!is_array($string)) {
|
||||
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
|
||||
$string = htmlspecialchars($string);
|
||||
$string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user