git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f30015b) | patch
Do not escape a unicode sequence when escaping JSON text.
Tue, 3 Jun 2014 20:11:31 +0000 (16:11 -0400)
Tue, 3 Jun 2014 20:11:31 +0000 (16:11 -0400)
commit 0ad1a816320a2b539a51628e2a0b1e83ff096b1d
Do not escape a unicode sequence when escaping JSON text.

Previously, any backslash in text being escaped for JSON was doubled so
that the result was still valid JSON. However, this led to some perverse
results in the case of Unicode sequences, These are now detected and the
initial backslash is no longer escaped. All other backslashes are
still escaped. No validity check is performed, all that is looked for is
\uXXXX where X is a hexidecimal digit.

This is a change from the 9.2 and 9.3 behaviour as noted in the Release
notes.

Per complaint from Teodor Sigaev.
doc/src/sgml/release-9.4.sgml diff | blob | blame | history
src/backend/utils/adt/json.c diff | blob | blame | history
src/test/regress/expected/json.out diff | blob | blame | history
src/test/regress/expected/json_1.out diff | blob | blame | history
src/test/regress/expected/jsonb.out diff | blob | blame | history
src/test/regress/expected/jsonb_1.out diff | blob | blame | history
src/test/regress/sql/json.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /