diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-25 12:09:13 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-25 12:09:13 +0100 |
commit | eb8e627c6918dae53c7ab8b9208e72ff64d20348 (patch) | |
tree | 4f153960d158c119ebdcef7a3a02c407e4b82dd0 /activesupport/lib/active_support/json/encoding.rb | |
parent | 4b8330d2d50ae4de14dd43ffbea4d91804553140 (diff) | |
parent | 1c66f85eb6cd80053cf60889634a8c39c21b11a1 (diff) | |
download | rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.gz rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.bz2 rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/lib/active_support/json/encoding.rb')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index 3c15056c41..c8415d5449 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -65,6 +65,15 @@ module ActiveSupport ESCAPED_CHARS = { + "\x00" => '\u0000', "\x01" => '\u0001', "\x02" => '\u0002', + "\x03" => '\u0003', "\x04" => '\u0004', "\x05" => '\u0005', + "\x06" => '\u0006', "\x07" => '\u0007', "\x0B" => '\u000B', + "\x0E" => '\u000E', "\x0F" => '\u000F', "\x10" => '\u0010', + "\x11" => '\u0011', "\x12" => '\u0012', "\x13" => '\u0013', + "\x14" => '\u0014', "\x15" => '\u0015', "\x16" => '\u0016', + "\x17" => '\u0017', "\x18" => '\u0018', "\x19" => '\u0019', + "\x1A" => '\u001A', "\x1B" => '\u001B', "\x1C" => '\u001C', + "\x1D" => '\u001D', "\x1E" => '\u001E', "\x1F" => '\u001F', "\010" => '\b', "\f" => '\f', "\n" => '\n', @@ -86,9 +95,9 @@ module ActiveSupport def escape_html_entities_in_json=(value) self.escape_regex = \ if @escape_html_entities_in_json = value - /[\010\f\n\r\t"\\><&]/ + /[\x00-\x1F"\\><&]/ else - /[\010\f\n\r\t"\\]/ + /[\x00-\x1F"\\]/ end end |