Jakub Zelenka wrote:

> On Thu, May 28, 2015 at 7:53 PM, Jakub Zelenka <bu...@php.net> wrote:
> 
>> There are two issues (reported bugs but not really bugs) in json_decode
>> related to \u escape.
>>
>> First one is
>> json_decode('{"\u0000": 1}');
>> reported in https://bugs.php.net/bug.php?id=68546
>>
>> That code result in fatal error due to using malformed property (private
>> props starting with \0). I don't think that anything parsed in json_decode
>> should result in a fatal error. That's why I would like to introduce a new
>> json error called JSON_ERROR_MANGLED_PROPERTY_NAME .
>
> I have just created a PR for that: https://github.com/php/php-src/pull/1332
> .. So if any objecting (e.g. error name), then shout now before I merge it
> to master...

Have you considered JSON_ERROR_INVALID_PROPERTY_NAME instead of
JSON_ERROR_MANGLED_PROPERTY_NAME, or for brevity JSON_ERROR_PROPERTY_NAME?

If the issue is considered to be a bug, it might be reasonable to
backport the fix to PHP 5.5 and 5.6.  The json-0 patch, which is
attached to the ticket, would have to be modified according to the error
constant.

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to