diff options
author | Eddie Kohler <ekohler@gmail.com> | 2015-12-28 19:05:09 -0500 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-01-22 19:40:58 +0000 |
commit | 104876dd8e3ddb5cb46971a8e1be100ba7d9b432 (patch) | |
tree | a0b589bd2ca0f14a7b30d47181b5a998f2218687 /ext/json/php_json.h | |
parent | 9b854ebab4ddd729a878b094268f639d2fa7b228 (diff) | |
download | php-git-104876dd8e3ddb5cb46971a8e1be100ba7d9b432.tar.gz |
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.
Diffstat (limited to 'ext/json/php_json.h')
-rw-r--r-- | ext/json/php_json.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/json/php_json.h b/ext/json/php_json.h index f1edc6c65a..d8bf0dfe9d 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -67,6 +67,7 @@ typedef enum { #define PHP_JSON_UNESCAPED_UNICODE (1<<8) #define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) #define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10) +#define PHP_JSON_UNESCAPED_LINE_TERMINATORS (1<<11) /* json_decode() options */ #define PHP_JSON_OBJECT_AS_ARRAY (1<<0) |