reverted stuff

This commit is contained in:
messju
2004-04-16 08:03:07 +00:00
parent 729ebe26ed
commit b73d2a7e63
8 changed files with 18 additions and 33 deletions

View File

@@ -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;