diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:34:43 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:34:43 +0000 |
commit | 4b3e964a1a9d9b5c4a7925ccb8a0090f869fdca4 (patch) | |
tree | 9825039c9fc649ca1be5c62dbe4547f1f9dd29fa /actionpack/lib/action_view/helpers | |
parent | 2e766b159f597f4da55a4cd57c20a9d8c34dd3e7 (diff) | |
download | rails-4b3e964a1a9d9b5c4a7925ccb8a0090f869fdca4.tar.gz rails-4b3e964a1a9d9b5c4a7925ccb8a0090f869fdca4.tar.bz2 rails-4b3e964a1a9d9b5c4a7925ccb8a0090f869fdca4.zip |
Fixed escaping of backslashes in JavaScriptHelper#escape_javascript (closes #6302) [sven@c3d2.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5242 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 3a5aaa6412..039a2f1810 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -149,7 +149,7 @@ module ActionView # Escape carrier returns and single and double quotes for JavaScript segments. def escape_javascript(javascript) - (javascript || '').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" } + (javascript || '').gsub('\\','\0\0').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" } end # Returns a JavaScript tag with the +content+ inside. Example: |