diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-10 14:38:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-10 14:38:23 -0300 |
commit | 4b57bc0c2aaaadfc72f8714b8cd2c88d7e9a7587 (patch) | |
tree | 884886bf2f48e43053f45ec54c32fb8c0240820d /activesupport/lib | |
parent | 9a43816928f07c4ed988fb47545d219eff55e28a (diff) | |
parent | 582b44175b627e3578fe71e1d452c429022da636 (diff) | |
download | rails-4b57bc0c2aaaadfc72f8714b8cd2c88d7e9a7587.tar.gz rails-4b57bc0c2aaaadfc72f8714b8cd2c88d7e9a7587.tar.bz2 rails-4b57bc0c2aaaadfc72f8714b8cd2c88d7e9a7587.zip |
Merge pull request #10534 from cmaruz/master
Escape of U+2028 and U+2029 in the JSON Encoder
Conflicts:
activesupport/lib/active_support/json/encoding.rb
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index 75655f88d3..7f8b41d218 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -108,7 +108,10 @@ module ActiveSupport '\\' => '\\\\', '>' => '\u003E', '<' => '\u003C', - '&' => '\u0026' } + '&' => '\u0026', + "#{0xe2.chr}#{0x80.chr}#{0xa8.chr}" => '\u2028', + "#{0xe2.chr}#{0x80.chr}#{0xa9.chr}" => '\u2029', + } class << self # If true, use ISO 8601 format for dates and times. Otherwise, fall back |