mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 05:11:36 +01:00
add javascript escape parameter to escape modifier
This commit is contained in:
@@ -37,6 +37,10 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
}
|
||||
return $return;
|
||||
|
||||
case 'javascript':
|
||||
// escape quotes and backslashes and newlines
|
||||
return str_replace(array('\\','\'',"\r","\n"), array("\\\\", "\\'",'\r','\r'), $string);
|
||||
|
||||
default:
|
||||
return $string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user