diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-11-06 17:17:07 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-11-06 17:17:07 -0800 |
commit | 240863a1680bbb7da00bac68e8aa1ee996bcdb57 (patch) | |
tree | 5518edc1602caa1f36985f9ea8f9a725fa99fed2 /activesupport/lib/active_support/json/decoding.rb | |
parent | 5584ddc43da6f3275c45305f50d934e505750f8c (diff) | |
parent | 798881ecd4510b9e1e5e10529fc2d81b9deb961e (diff) | |
download | rails-240863a1680bbb7da00bac68e8aa1ee996bcdb57.tar.gz rails-240863a1680bbb7da00bac68e8aa1ee996bcdb57.tar.bz2 rails-240863a1680bbb7da00bac68e8aa1ee996bcdb57.zip |
Merge pull request #12785 from chancancode/do_not_leak_internal_state
Do not expose internal state in the public encoder API (i.e. as_json)
Diffstat (limited to 'activesupport/lib/active_support/json/decoding.rb')
-rw-r--r-- | activesupport/lib/active_support/json/decoding.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb index 315c76199a..8b5fc70dee 100644 --- a/activesupport/lib/active_support/json/decoding.rb +++ b/activesupport/lib/active_support/json/decoding.rb @@ -7,6 +7,9 @@ module ActiveSupport mattr_accessor :parse_json_times module JSON + # matches YAML-formatted dates + DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/ + class << self # Parses a JSON string (JavaScript Object Notation) into a hash. # See www.json.org for more info. |