Jean Boussier
93fc29c65c
[ruby/json] Deprecate duplicate keys in object
...
There are few legitimate use cases for duplicate keys, and can
in some case be exploited.
Rather to always silently accept them, we should emit a warning,
and in the future require to explictly allow them.
06f00a42e8
2025-06-24 12:10:50 +09:00
Jean Boussier
b310e7b3c7
[ruby/json] Add missing parser options documentation
...
eed753ffde
2025-06-24 12:10:50 +09:00
Jean Boussier
ca8f21ace8
[ruby/json] Resync
2024-11-05 18:00:36 +01:00
Jean Boussier
1045b9f820
[ruby/json] Modernize heredocs
...
fb25e94aea
2024-10-26 18:44:15 +09:00
Étienne Barrié
82f7550f65
Use frozen string literals
...
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-10-26 18:44:15 +09:00
Jean Boussier
0dfeb17296
Rename escape_slash in script_safe and also escape E+2028 and E+2029
...
It is rather common to directly interpolate JSON string inside
<script> tags in HTML as to provide configuration or parameters to a
script.
However this may lead to XSS vulnerabilities, to prevent that 3
characters need to be escaped:
- `/` (forward slash)
- `U+2028` (LINE SEPARATOR)
- `U+2029` (PARAGRAPH SEPARATOR)
The forward slash need to be escaped to prevent closing the script
tag early, and the other two are valid JSON but invalid Javascript
and can be used to break JS parsing.
Given that the intent of escaping forward slash is the same than escaping
U+2028 and U+2029, I chos to rename and repurpose the existing `escape_slash`
option.
2023-12-01 16:47:06 +09:00
Masafumi Koba
8a974dc83c
[flori/json] Fix incorrect #
position in API doc
...
This change fixes an incorrect `#` position in the API documentation of the `JSON` module.
dc4b62424f
2021-05-17 19:26:03 +09:00
BurdetteLamar
8c057bb845
[flori/json] RDoc example for JSON.load
...
e4eead665c
2020-09-25 17:28:42 +09:00
BurdetteLamar
71b1bbad02
[flori/json] Move options from #generate and #parse to common area
...
20d7be605a
2020-09-25 17:28:42 +09:00
BurdetteLamar
be6447381c
[flori/json] RDoc enhancements
...
470d909c0d
2020-07-01 18:47:51 +09:00
BurdetteLamar
99980b3034
[flori/json] RDoc enhancements
...
7bee2c7c13
2020-07-01 18:47:51 +09:00
BurdetteLamar
4689fd5f99
[flori/json] Rdoc enhancements
...
e7e3732130
2020-07-01 18:47:50 +09:00
zverok
41ef6df8c9
[flori/json] Fix examples syntax
...
3845491d92
2020-01-06 15:13:35 +09:00
zverok
2e5ef30cb9
[flori/json] Enchance generic JSON and #generate docs
...
4ede0a7d19
2020-01-06 15:13:15 +09:00
Jeremy Evans
1658e6b5db
[flori/json] Remove invalid JSON.generate description from JSON module rdoc
...
This text used to be true in older versions of json, but has not
been true for a number of years (since json version 2 I think).
373b633f38
2020-01-06 15:09:55 +09:00
hsbt
bf7cc652ae
* ext/json/**/*.rb: merge original files from upstream repository.
...
It only fixes styles of frozen string literal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 03:48:54 +00:00
naruse
c4fdfabcc8
handle ext/ as r53141
...
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt
2e4f0af00f
* ext/json/*, test/json/*: Reverted r50231. Because it's not works with
...
cross-compile environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 08:36:37 +00:00
hsbt
cfaddc2a32
* ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
...
[fix GH-867][Feature #11057 ]
* test/ruby/test_extlibs.rb: removed json gem from existence extentions.
* gems/bundled_gems: added json gem into bundled gem.
* lib/rdoc/rubygems_hook.rb: ignored no json environment.
* lib/rubygems/test_case.rb, test/rubygems/*: ditto.
* lib/rdoc/test_case.rb, test/rdoc/*: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 11:14:36 +00:00
zzak
53bc349069
* ext/json/lib/json.rb: Move module overview definition for rdoc
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 19:39:15 +00:00
naruse
b14c060dda
* ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
...
[Bug #5173 ] [ruby-core:38866]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 02:23:12 +00:00
naruse
a2e497d5ed
* ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
...
[Bug #4700 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 08:01:04 +00:00
nobu
4e637b320f
* ext/json/lib/**/*.rb: not executable.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-04 01:05:00 +00:00
naruse
c719ecb535
* ext/json: Update to JSON 1.1.9.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-01 16:17:56 +00:00
naruse
4f364c6bf7
Update to JSON 1.1.4.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-05 02:32:49 +00:00
nobu
287a34ae0d
* {ext,lib,test}/**/*.rb: removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
naruse
825ce503c0
* lib/json.rb, lib/json/*: moved to ext/json/lib.
...
--
M trunk/ChangeLog
D trunk/lib/json
D trunk/lib/json.rb
A trunk/ext/json/lib
A trunk/ext/json/lib/json
A trunk/ext/json/lib/json.rb
A trunk/ext/json/extconf.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-04 08:09:44 +00:00