Ticket #8425: json_decode_alternating_quote_types_with_test.diff
| File json_decode_alternating_quote_types_with_test.diff, 1.0 kB (added by deepblue, 2 years ago) |
|---|
-
activesupport/test/json/decoding_test.rb
old new 13 13 %(1) => 1, 14 14 %("") => "", 15 15 %("\\"") => "\"", 16 %("'':") => "'':", 16 17 %(null) => nil, 17 18 %(true) => true, 18 19 %(false) => false -
activesupport/lib/active_support/json/decoding.rb
old new 22 22 while scanner.scan_until(/(['":,]|\\.)/) 23 23 case char = scanner[1] 24 24 when '"', "'" 25 quoting = quoting == char ? false : char25 quoting = quoting == char ? false : (quoting ? quoting : char) 26 26 when ":", "," 27 27 marks << scanner.pos - 1 unless quoting 28 28 end