mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 12:33:56 +02:00
* ext/json: merge JSON 1.7.7.
This includes security fix. [CVE-2013-0269]
d0a62f3ced
https://groups.google.com/d/topic/rubyonrails-security/4_YvCpLzL58/discussion
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f1194eb9b0
commit
062d2ee6f7
20 changed files with 269 additions and 99 deletions
|
@ -4,10 +4,16 @@ end
|
|||
defined?(::BigDecimal) or require 'bigdecimal'
|
||||
|
||||
class BigDecimal
|
||||
# Import a JSON Marshalled object.
|
||||
#
|
||||
# method used for JSON marshalling support.
|
||||
def self.json_create(object)
|
||||
BigDecimal._load object['b']
|
||||
end
|
||||
|
||||
# Marshal the object to JSON.
|
||||
#
|
||||
# method used for JSON marshalling support.
|
||||
def as_json(*)
|
||||
{
|
||||
JSON.create_id => self.class.name,
|
||||
|
@ -15,6 +21,7 @@ class BigDecimal
|
|||
}
|
||||
end
|
||||
|
||||
# return the JSON value
|
||||
def to_json(*)
|
||||
as_json.to_json
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue