Commit Graph

219 Commits

Author SHA1 Message Date
Nikita Popov
aa0d886cbc Don't leak json error_code across requests 2020-10-22 12:42:09 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Máté Kocsis
3fe49d81f8
Generate method entries from stubs for a couple of extensions
Closes GH-5368
2020-04-11 13:28:53 +02:00
Máté Kocsis
50765075db
Improve some ValueError messages
Closes GH-5340
2020-04-06 10:41:01 +02:00
Máté Kocsis
5322de1ba8
Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Máté Kocsis
8f4f1dea34
Convert zend_parse_parameters_none() to fast ZPP
I've done the conversion in those extensions where fast ZPP is predominant.
2020-01-03 13:23:37 +01:00
Máté Kocsis
01a50778d1
Use RETURN_THROWS() after zend_throw_exception() in most of the extensions 2020-01-02 10:56:18 +01:00
Máté Kocsis
12ce73a5bb
Use RETURN_THROWS() after zend_value_error() 2019-12-31 16:58:15 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
George Peter Banyard
734932ecbb Convert warnings to ValueError 2019-12-08 21:03:14 +01:00
Christoph M. Becker
49b98b4d5c Add arginfo stub for JsonSerializable 2019-10-05 11:10:30 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Craig Duncan
7e7eaa0eb2 Convert json functions arginfo to php stubs
Closes GH-4500
2019-08-10 16:04:30 +01:00
Peter Kokot
dee243d475 Bump PHP_JSON_VERSION to PHP_VERSION
Closes GH-4459
2019-07-24 22:19:33 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Andrea Faulds
e823770515 Merge JSON_THROW_ON_ERROR 2017-10-22 19:41:23 +01:00
Jakub Zelenka
0f047f60f0 [ci skip] Remove CSV leftovers from json code - $Id$ 2017-07-16 15:51:39 +01:00
Jakub Zelenka
9c58822653 Introduce internal php_json_encode_ex to allow extensions setting depth 2017-07-16 15:47:23 +01:00
Jakub Zelenka
0d0f7cde8c Add JSON_INVALID_UTF8_SUBSTITUTE and JSON_INVALID_UTF8_IGNORE
It implements request #65082 and adds options for replacing resp.
ignoring invalid UTF-8 sequences for json_encode and json_decode.
2017-07-16 12:35:24 +01:00
Dmitry Stogov
9c2a1f52a5 Avoid useless dereferences and separations during paramter passing. 2017-06-19 12:55:59 +03:00
Sara Golemon
aa2282df21 Allow JSON_OBJECT_AS_ARRAY option to actually have meaning
Options can only be passed if $assoc is passed, but passing
assoc clobbers any attempt to pass JSON_OBJECT_AS_ARRAY as an
option.

Allow the option to occur in the options field by handling
"null" as default/use-options.
2017-03-17 15:36:24 -07:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
6007eb7584 Use new param API in json 2016-12-31 08:35:07 -08:00
Anatol Belski
d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski
5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Jakub Zelenka
f284479734 Merge branch 'PHP-7.0' into PHP-7.1 2016-11-20 20:38:34 +00:00
Jakub Zelenka
60574ea1ac Fix bug #73526 (php_json_encode depth issue) 2016-11-20 20:36:03 +00:00
Jakub Zelenka
c34de0b61c Introduce json encoder to fix globals related issues
It fixes bugs #66025 and #73254 by replacing globals with
a passed structure holding depth and error code. In addition
it fixes #72069 in a more generic way.
2016-10-30 13:20:10 +00:00
Julien Pauli
b41abf7496 Fix 73113 - Segfault with throwing JsonSerializable 2016-09-19 15:16:14 +02:00
Jakub Zelenka
12a8c3f6e7 Add initial failure checking for json_encode 2016-08-29 14:49:40 +01:00
Jakub Zelenka
37c12f8f86 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-14 14:01:36 +01:00
Jakub Zelenka
436d50a821 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-14 14:00:35 +01:00
Jakub Zelenka
9f1d962ed6 Fixed bug #72787 (json_decode reads out of bounds) 2016-08-14 13:52:59 +01:00
Jakub Zelenka
bea131f0bc Add return code from json API functions
It will allow fix few json bugs in a better way
2016-06-28 20:49:38 +01:00
Jakub Zelenka
3f13507dd2 Use one place to define max length of double
Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose
2016-06-26 14:03:01 +01:00
Jakub Zelenka
75b86a2c22 Replace json.precision with serialize_precision 2016-06-26 13:26:43 +01:00
Yasuo Ohgaki
3aa2aadcf0 Add JSON_G(precision) 2016-06-26 13:26:43 +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
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
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
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
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