mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
reverted stuff
This commit is contained in:
@@ -51,12 +51,7 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
|
||||
case 'javascript':
|
||||
// escape quotes and backslashes and newlines
|
||||
$return = strtr($string, array(
|
||||
"\x08" => '\\b', "\x09" => '\\t', "\n" => '\\n',
|
||||
"\x0b" => '\\v', "\x0c" => '\\f', "\r" => '\\r',
|
||||
'"' => '\\"', '\'' => '\\\'', '\\' => '\\\\'));
|
||||
|
||||
return preg_replace('!<(/\w)!', "<\\\\$1", $return);
|
||||
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n'));
|
||||
|
||||
default:
|
||||
return $string;
|
||||
|
||||
Reference in New Issue
Block a user