Bug #71746 [Opn]: UTF-8 codepoint escape sequences allow arbitrary number of leading zeros

From: Date: Tue, 08 Mar 2016 21:19:20 +0000
Subject: Bug #71746 [Opn]: UTF-8 codepoint escape sequences allow arbitrary number of leading zeros
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199677@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71746&edit=1

 ID:                 71746
 Updated by:         yohgaki@php.net
 Reported by:        temp at temp dot ru
 Summary:            UTF-8 codepoint escape sequences allow arbitrary
                     number of leading zeros
 Status:             Open
 Type:               Bug
 Package:            *Compile Issues
 PHP Version:        7.0.4
 Block user comment: N
 Private report:     N

 New Comment:

However, ES6 seems to have the same spec.

https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point

IMO, this should be fixed as it only introduces complexity for validations.


Previous Comments:
------------------------------------------------------------------------
[2016-03-08 21:12:04] yohgaki@php.net

This must be fixed. Recent Unicode does not allow this kind of redundant expressions.

------------------------------------------------------------------------
[2016-03-08 15:43:37] temp at temp dot ru

Description:
------------
PHP documentation specifies the following format of UTF-8 codepoint escape sequences:
\u{[0-9a-f]{1,6}}

However, it's currently possible to use them like this:

<?php
echo "\u{0000000000000000000000000000000000000000000000000041}"; //Works

Moreover, it's currently possible to use capital hexadecimal letters despite documentation
says, that only lower-case letters are allowed:

<?php
echo "\u{AA}"; //Works

I'm not sure if these are documentation or compiler bugs.




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71746&edit=1


Thread (3 messages)

« previous php.bugs (#199677) next »