Commit graph

428 commits

Author SHA1 Message Date
Xinchen Hui
197470b62f Revert "Fixed bug #72170 (JsonSerializable may inc apply count without dec it)"
This reverts commit 459a7cc209.
2016-05-06 20:25:24 +08:00
Xinchen Hui
459a7cc209 Fixed bug #72170 (JsonSerializable may inc apply count without dec it)
I don't want use zend_try here, but seems I have no choice :<
2016-05-06 18:38:26 +08:00
Jakub Zelenka
afb4062c2c Merge branch 'json_parser_method' into json_parser_method_embed 2016-05-03 19:55:55 +01:00
Jakub Zelenka
34a9882ad3 Merge branch 'master' into json_parser_method 2016-05-03 19:55:41 +01:00
Jakub Zelenka
37048c0f6c Use embedded json parser method structure 2016-05-02 13:02:40 +01:00
Xinchen Hui
fa5f28a0a1 Merge branch 'PHP-7.0' 2016-04-22 21:41:52 -07:00
Xinchen Hui
589d0e0f18 Fixed bug #72069 (Behavior \JsonSerializable different from json_encode) 2016-04-22 21:41:44 -07:00
Jakub Zelenka
93b67dd511 Remove json parser depth methods and tidy it up 2016-04-10 16:10:26 +01:00
Jakub Zelenka
72ccfda25a Add method hooking support to json parser
This commit is just a slight modification (renaming and some small
changes) of the patch that has been provided by Andrey Hristov.
It adds support for hooking of the json parser operations and
allows re-using of modified JSON parsing outside of json ext.
2016-04-10 15:35:41 +01:00
Xinchen Hui
3f3180e35f Merge branch 'PHP-7.0'
* PHP-7.0:
  Update test script
2016-03-22 11:28:45 +08:00
Xinchen Hui
b49ec68134 Update test script 2016-03-22 11:28:19 +08:00
Xinchen Hui
1e5ac8940a Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable)
2016-03-21 16:22:02 +08:00
Jakub Zelenka
7e069daa89 Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable) 2016-03-20 15:56:27 +00:00
Nikita Popov
f57c0b3249 Merge branch 'PHP-7.0' 2016-03-03 16:50:47 +01:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
James Titcumb
c4b188871e Fix bug #71575 removing extra semicolons outside macros 2016-03-03 16:41:03 +01:00
Eddie Kohler
104876dd8e json_encode: Escape U+2028 and U+2029 more often.
These characters are illegal in Javascript, so leaving them unescaped
is risky. The default encoder ($flags = 0) is fine, but the encoder
with JSON_UNESCAPED_UNICODE flag is not.

In case anyone wants the ability to leave these characters unescaped,
provide JSON_UNESCAPED_LINE_TERMINATORS.
2016-01-22 19:40:58 +00:00
Lior Kaplan
2eb1f38d24 Happy new year (Update copyright to 2016) 2016-01-01 20:03:16 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Jakub Zelenka
3c32019989 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-15 19:13:49 +00:00
Jakub Zelenka
e5abc53701 Use the same CS for all json tests 2015-11-15 19:06:09 +00:00
Jakub Zelenka
539db00538 Simplify JSON constants registration 2015-09-04 20:00:29 +01:00
Jakub Zelenka
6e5574807f Add my name to authors for previous refactoring
Related to jsond changes
2015-09-04 19:56:59 +01:00
Jakub Zelenka
7fe2646be3 Move json_decode options macros bellow encode options 2015-09-04 19:37:12 +01:00
Ryan McCullagh
45fdff1c85 json: fix formating of PHP_JSON* option bitshifts 2015-09-04 19:29:54 +01:00
Joe Watkins
26e619b192 these need to be exported for extensions that use json 2015-09-03 19:28:34 +01:00
Kubo2
f18ba0f9c9 Add tests for json_last_error()/json_last_error_msg() failures 2015-07-21 01:50:40 +02:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Christoph M. Becker
22767a48a7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add tests for json_last_error()/json_last_error_msg() failures
2015-07-21 02:00:16 +02:00
Jakub Zelenka
4540e644ec Regenerate bison and re2c files in json 2015-07-18 17:41:17 +01:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Jakub Zelenka
f30503ce4e Fix incompatible JSON errors
This fixes differences in error codes with PHP 5 and 7.
The malformed UTF-8 and control character error codes are
now returned even in non-string context which makes it
the same as it was in PHP 5 json ext.
2015-06-28 18:09:10 +01:00
Jakub Zelenka
64c371142c Fix bug #62010 (json_decode produces invalid byte-sequences) 2015-06-28 17:16:12 +01:00
Jakub Zelenka
695b4f4cad Bump re2c version for json scanner 2015-06-28 16:48:42 +01:00
Jakub Zelenka
f3df3df873 Fix bug #68546 (json_decode cannot access property started with \0) 2015-06-21 15:30:33 +01:00
Jakub Zelenka
61de771afa Improve json parser code 2015-06-07 15:22:09 +01:00
Jakub Zelenka
359df4dea8 Tidy up and regenerate json parser with latest bison version 2015-05-10 18:08:16 +01:00
Xinchen Hui
76fb02123f Optimized json_parser
1. use zend_string in key
2. use faster APIs
3. use ZVAL_COPY_VALUE instead of assignment (save u2 copy)
2015-05-06 11:37:30 +08:00
Xinchen Hui
9f0dbdf6c8 Use Z_ARRVAL_P since we already know it's an array 2015-05-06 11:10:33 +08:00
Stanislav Malyshev
d66cb721d4 Merge remote-tracking branch 'github/pr/637' into PHP-5.6
* github/pr/637:
  Remove unused code from ext/json.
2015-04-18 17:56:33 -07:00
Anatol Belski
fe36285de2 fix datatype mismatches 2015-03-25 15:32:35 +01:00
Lior Kaplan
a4384bd3d4 s/PHP Version 5/PHP Version 7/g
Follow up for d0cb7153
2015-03-13 11:09:42 +02:00
Dmitry Stogov
d68861eb4b Improved php_json_escape_string() 2015-03-11 15:03:07 +03:00
Reeze Xia
609f05fc19 ZTS cleanup 2015-03-08 19:25:55 +08:00
Hugo Fonseca
baece85399 Added test for bug 69187 2015-03-07 10:53:31 +00:00
Jakub Zelenka
ad2b751985 Merge branch 'PHP-5.6'
The fix for master is a bit different (it's fixed in encoder)
2015-02-22 20:54:05 +00:00
Jakub Zelenka
97d809a8a5 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/json/json.c
2015-02-22 20:35:03 +00:00
Jakub Zelenka
591dbcabe5 Fix bug #64695 (JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e) 2015-02-22 20:22:47 +00:00
Jakub Zelenka
3ddc246b5a Set PHP_JSON_VERSION to 1.4.0 2015-02-17 20:52:06 +00:00