mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 12:14:12 +02: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