Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8425: json_decode_alternating_quote_types.diff

File json_decode_alternating_quote_types.diff, 0.6 kB (added by canadaduane, 2 years ago)
  • activesupport/lib/active_support/json/decoding.rb

    old new  
    2222          while scanner.scan_until(/(['":,]|\\.)/) 
    2323            case char = scanner[1] 
    2424            when '"', "'" 
    25               quoting = quoting == char ? false : char 
     25              quoting = quoting == char ? false : (quoting ? quoting : char) 
    2626            when ":", "," 
    2727              marks << scanner.pos - 1 unless quoting 
    2828            end