diff options
author | Jakub Zelenka <bukka@php.net> | 2017-07-16 12:35:24 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2017-07-16 12:35:24 +0100 |
commit | 0d0f7cde8c321ae841ba0f60f4377b72f98db637 (patch) | |
tree | 9382ab16cf35c723187e4894b2c0bb38d490abb4 /ext/json/json.c | |
parent | f6a44916623f9d8dc24d35d52f2998700f0567a6 (diff) | |
download | php-git-0d0f7cde8c321ae841ba0f60f4377b72f98db637.tar.gz |
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.
Diffstat (limited to 'ext/json/json.c')
-rw-r--r-- | ext/json/json.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 9c930ee1bc..e645f7c52b 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -115,6 +115,10 @@ static PHP_MINIT_FUNCTION(json) PHP_JSON_REGISTER_CONSTANT("JSON_OBJECT_AS_ARRAY", PHP_JSON_OBJECT_AS_ARRAY); PHP_JSON_REGISTER_CONSTANT("JSON_BIGINT_AS_STRING", PHP_JSON_BIGINT_AS_STRING); + /* common options for json_decode and json_encode */ + PHP_JSON_REGISTER_CONSTANT("JSON_INVALID_UTF8_IGNORE", PHP_JSON_INVALID_UTF8_IGNORE); + PHP_JSON_REGISTER_CONSTANT("JSON_INVALID_UTF8_SUBSTITUTE", PHP_JSON_INVALID_UTF8_SUBSTITUTE); + /* json error constants */ PHP_JSON_REGISTER_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE); PHP_JSON_REGISTER_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH); |