aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
diff options
context:
space:
mode:
authorDaniel Sheppard <daniel.sheppard@gmail.com>2009-08-09 11:27:17 +0400
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-09 22:30:44 -0700
commitb3381cacaf7735ec6eb108e378ba255ebf6ffb14 (patch)
tree5e572766e55b6ea01623de6981f2f1e0a3d2e3cb /activesupport/lib/active_support/json
parent0c391b46fb39b697bbae1493caade23e2ddbd8a6 (diff)
downloadrails-b3381cacaf7735ec6eb108e378ba255ebf6ffb14.tar.gz
rails-b3381cacaf7735ec6eb108e378ba255ebf6ffb14.tar.bz2
rails-b3381cacaf7735ec6eb108e378ba255ebf6ffb14.zip
Fix that JSON parser fails to read escaped backslashes.
[#973 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/json')
-rw-r--r--activesupport/lib/active_support/json/backends/yaml.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/backends/yaml.rb b/activesupport/lib/active_support/json/backends/yaml.rb
index 92dd31cfbc..59d2c37e40 100644
--- a/activesupport/lib/active_support/json/backends/yaml.rb
+++ b/activesupport/lib/active_support/json/backends/yaml.rb
@@ -20,7 +20,7 @@ module ActiveSupport
rescue ArgumentError => e
raise ParseError, "Invalid JSON string"
end
-
+
protected
# Ensure that ":" and "," are always followed by a space
def convert_json_to_yaml(json) #:nodoc:
@@ -42,6 +42,8 @@ module ActiveSupport
end
when ":",","
marks << scanner.pos - 1 unless quoting
+ when "\\"
+ scanner.skip(/\\/)
end
end
@@ -89,3 +91,4 @@ module ActiveSupport
end
end
end
+