diff options
author | Mario Caropreso <mario.caropreso@gmail.com> | 2013-05-09 13:41:56 +0100 |
---|---|---|
committer | Mario Caropreso <mario.caropreso@gmail.com> | 2013-05-09 13:41:56 +0100 |
commit | 582b44175b627e3578fe71e1d452c429022da636 (patch) | |
tree | 427affdfc7b0836eef4c5b5bc175f8dbfad2c967 /activerecord/lib/active_record/counter_cache.rb | |
parent | cecef59fa2f670bbd5b61fcaf54bceae2c4628b0 (diff) | |
download | rails-582b44175b627e3578fe71e1d452c429022da636.tar.gz rails-582b44175b627e3578fe71e1d452c429022da636.tar.bz2 rails-582b44175b627e3578fe71e1d452c429022da636.zip |
Added escaping of U+2028 and U+2029 inside the json encoder.
U+2028 and U+2029 are allowed inside strings in JSON (as all literal
Unicode characters) but JavaScript defines them as newline
seperators. Because no literal newlines are allowed in a string, this
causes a ParseError in the browser. We work around this issue by
replacing them with the escaped version. The resulting JSON is still
valid and can be parsed in the browser.
This commit has been coauthored with Viktor Kelemen @yikulju
Diffstat (limited to 'activerecord/lib/active_record/counter_cache.rb')
0 files changed, 0 insertions, 0 deletions