mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Improve escape_javascript performance.
This commit is contained in:
parent
49d1b5a98d
commit
2bb7dbf75d
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ module ActionView
|
|||
if javascript.empty?
|
||||
result = ""
|
||||
else
|
||||
result = javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"'])/u) { |match| JS_ESCAPE_MAP[match] }
|
||||
result = javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"'])/u, JS_ESCAPE_MAP)
|
||||
end
|
||||
javascript.html_safe? ? result.html_safe : result
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue