aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/decoding.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2013-11-06 17:17:07 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2013-11-06 17:17:07 -0800
commit240863a1680bbb7da00bac68e8aa1ee996bcdb57 (patch)
tree5518edc1602caa1f36985f9ea8f9a725fa99fed2 /activesupport/lib/active_support/json/decoding.rb
parent5584ddc43da6f3275c45305f50d934e505750f8c (diff)
parent798881ecd4510b9e1e5e10529fc2d81b9deb961e (diff)
downloadrails-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.rb3
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.