Commit Graph

359 Commits

Author SHA1 Message Date
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
Jakub Zelenka
011eab1047 Delete json outdated package.xml
The package.xml has not been update for more then 8 years and
there is no reason to keep it. It would require quite
a bit of digging in git history to update it which is
not worth it.
2015-02-16 20:07:01 +00:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Jakub Zelenka
5f82c9256d Update JSON Readme 2015-02-15 20:04:16 +00:00
Jakub Zelenka
549c6fa465 Remove unused destructor in json parser 2015-02-15 19:46:41 +00:00
Jakub Zelenka
911f7b10b1 Add bison 3.0.4 genereted files for json parser
The definitions file (json_parser.tab.h) contains file
system dependent name for C preprocessor guard:

YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED

This is because the srcdir is used for default definitions name.
It's a correct default (--definition=$(srcdir)/json_parser.tab.h)
because the build would fail otherwise. Unfortunately Bison does not have
a special option for defining cpp guard name. The only way would be
using skeleton file but that's not possible with the current
configuration as it requires using a specific bison version
(disallowing range of supported versions).
2015-02-15 19:28:37 +00:00
Jakub Zelenka
09d27da1ba Regenerate json scanner with re2c 0.13.7.5 2015-02-15 18:08:58 +00:00
Anatol Belski
ca9ab1c993 better alignment + support size_t 2015-02-10 16:02:55 +01:00
Anatol Belski
4a875e18fd use portable strtol 2015-02-10 13:06:57 +01:00
Michael Wallner
09a3e7377a fix json globals 2015-02-09 17:57:18 +01:00
Anatol Belski
8989354130 regenerated scanner 2015-02-09 11:22:50 +01:00
Anatol Belski
ef2fd13de8 fix datatype mismatches 2015-02-09 11:06:02 +01:00
Anatol Belski
12fff5251b fix inconsistend dll linkage warn 2015-02-09 10:51:29 +01:00
Anatol Belski
fc5b349789 size_t vs int 2015-02-09 10:47:39 +01:00
Anatol Belski
a1208b4726 use size_t for str length 2015-02-09 10:43:27 +01:00
Anatol Belski
6747c166d8 generate missing json files from config.w32 2015-02-09 10:12:26 +01:00
Jakub Zelenka
f2825042b4 Merge branch 'master' into jsond
Conflicts:
	ext/json/json.c
2015-02-08 14:08:31 +00:00
Julien Pauli
93315c4e1d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Revert "json_decode() should generate a syntax error when given ""."
  Update NEWS
2015-02-04 12:48:57 +01:00
Julien Pauli
c85f12e3ac Revert "json_decode() should generate a syntax error when given ""."
This reverts commit a7b3abe4e6.
2015-02-04 12:48:17 +01:00
Dmitry Stogov
2428fd1c8b Use object pointers instead of handles 2015-02-04 12:01:55 +03:00
Jakub Zelenka
c3cd2d33ca Fix invalid test for bug 54484 2015-02-02 20:53:27 +00:00
Jakub Zelenka
fdc14c64be Add re2c sources 2015-02-02 19:55:29 +00:00
Jakub Zelenka
3e4c1717ee Merge branch 'master' into jsond 2015-02-02 19:53:32 +00:00
Jakub Zelenka
20bae2a503 Give me credit 2015-02-02 19:33:48 +00:00
Adam Harvey
9e20b64a5b Merge branch 'PHP-5.6' 2015-02-02 11:12:27 +00:00
Adam Harvey
db375cfd4d Merge branch 'PHP-5.5' into PHP-5.6 2015-02-02 11:11:05 +00:00
Adam Harvey
a7b3abe4e6 json_decode() should generate a syntax error when given "".
Fixes bug #68938 (json_decode() decodes empty string without error).
Patch by jeremy at bat-country dot us.
2015-02-02 11:07:34 +00:00
Jakub Zelenka
3159d518d0 Merge branch 'master' into jsond
Conflicts:
	ext/json/JSON_parser.c
	ext/json/json.c
2015-01-25 18:43:15 +00:00
Stanislav Malyshev
1fdd558e39 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #50224 where float without decimals were converted to integer
  Updated NEWS for #68371
2015-01-19 10:05:57 -08:00
Juan Basso
ac7cfad3b5 Fixed bug #50224 where float without decimals were converted to integer 2015-01-19 00:46:02 -08:00
Jakub Zelenka
3ddb5993dd Increase PHP_JSON_DOUBLE_MAX_LENGTH for fractional part
This is probably not necessary as such number
is not realistic. It's just to be consistent
with jsond extension.
2015-01-18 16:31:24 +00:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
7f95aa4d97 Fix bug #68817: Null pointer deference 2015-01-14 16:12:35 -08:00
Juan Basso
95cef47afb Porting implementation of RFC json_preserve_fractional_part 2015-01-12 21:29:52 -05:00
Jakub Zelenka
e6fb493e5d Refactore json double encoding to use php_gcvt 2015-01-11 13:30:21 +00:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Jakub Zelenka
8304e468cd Replace encoder functions json prefix with php_json 2015-01-10 19:13:28 +00:00
Jakub Zelenka
1119c4d2b2 Allow ill-formed unicode escapes in decoder 2015-01-04 17:34:49 +00:00
Jakub Zelenka
8e10250449 Use ZVAL_COPY_VALUE for copying parser result to return_value 2015-01-01 19:19:31 +00:00
Jakub Zelenka
b68da91d52 Merge branch 'master' into jsond
Conflicts:
	ext/json/JSON_parser.c
	ext/json/JSON_parser.h
	ext/json/config.m4
	ext/json/config.w32
	ext/json/json.c
	ext/json/php_json.h
2014-12-27 19:42:04 +00:00
Jakub Zelenka
4f6539bdaf Remove old parser 2014-12-14 19:12:24 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Jakub Zelenka
0bfa245aa3 Modify json/tests/pass003 to ignore internal object ID
Child is now created first - bottom up parsing (LR)
2014-12-12 20:00:08 +00:00
Jakub Zelenka
9e5f687957 Fix json object decoding 2014-12-12 19:52:45 +00:00
Jakub Zelenka
c6d0905158 Do not copy return_value in parser 2014-12-07 20:27:03 +00:00
Jakub Zelenka
c51ea47996 Change string buffer handling in json scanner 2014-12-03 20:47:52 +00:00
Jakub Zelenka
098097d83f Fix compilation for json scanner 2014-11-30 18:29:48 +00:00
Jakub Zelenka
f18aae6042 Fix compilation for json_encoder 2014-11-30 17:47:17 +00:00
Jakub Zelenka
79e8355631 Fix compilation issues in json_parser 2014-11-26 20:49:55 +00:00
Jakub Zelenka
a4e59c39a7 Add missing bits to php_json.h 2014-11-25 20:36:41 +00:00
Jakub Zelenka
e18dd67975 Move json encoding stuff 2014-11-24 20:46:13 +00:00
Jakub Zelenka
f00b80a511 Implement initial changes for json_parser 2014-11-23 19:53:06 +00:00
Jakub Zelenka
ba70ba5f13 Replace INIT_PZVAL_COPY with ZVAL_DUP 2014-11-16 15:21:01 +00:00
Jakub Zelenka
432b73fdee Add error codes to php_json.h 2014-11-16 15:13:15 +00:00
Jakub Zelenka
d07bf91328 Initial import of jsond 2014-11-13 20:20:46 +00:00
Anatol Belski
7a6a3d923b fix arg order, CFLAGS is the fifth arg in m4 2014-10-17 16:03:40 +02:00
Anatol Belski
fea10f6a5e ext/iconv, ext/json and ext/session use static tsrmls pointer 2014-10-17 14:16:40 +02:00
Nikita Popov
016a96c7c2 Fix ::jsonSerialize() failure message 2014-10-12 20:55:51 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Nikita Popov
37aaccad7d Use inline functions for most of smart_str
smart_str_free_ex no longer exists, always use smart_str_free instead.

smart_str_alloc no longer requires a newlen variable to be in scope,
instead it returns the new length.
2014-09-19 23:39:07 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
19f8217113 reduce struct size by 8 byte on 64 bit 2014-09-17 09:03:47 +02:00
Anatol Belski
232459efd0 fix signature 2014-08-27 22:13:01 +02:00
Anatol Belski
074c68e9ce fix signature 2014-08-27 22:05:26 +02:00
Anatol Belski
6db8d4f829 's' works with size_t round 3 2014-08-27 20:49:36 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00