#31357 [Opn->Bgs]: PHP gives indulgences when a developer uses wrong escaping
| From: | tony2001@php.net | Date: | Thu, 30 Dec 2004 23:51:37 +0000 |
| Subject: | #31357 [Opn->Bgs]: PHP gives indulgences when a developer uses wrong escaping | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71325@lists.php.net to get a copy of this message | ||
ID: 31357
Updated by: tony2001@php.net
Reported By: wicked at ngs dot ru
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Win XP + SP1
PHP Version: 4.3.8
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Escaped characters are pretty well documented and I don't understand
what do you complain about.
See here: http://www.php.net/manual/en/language.types.string.php
Previous Comments:
------------------------------------------------------------------------
[2004-12-30 20:41:16] wicked at ngs dot ru
Description:
------------
I expect that
print "\a";
will fail because there is no entity like \a among
\n, \r, \t, \\, \$, \", \[0-7]{1,3} and \x[0-9A-Fa-f]{1,2}.
It is like that browsers like IE shows "&abc" as there were written
"&abc".
It's harmful.
More than that, I and some other PHP experts have been puzzleing why
this string works:
$tokens = preg_split('/(?<!\\\)[&?!]/', $query, -1,
PREG_SPLIT_DELIM_CAPTURE);
Everybody expected that ) was escaped!
Reproduce code:
---------------
$tokens = preg_split('/(?<!\\\)[&?!]/', $query, -1,
PREG_SPLIT_DELIM_CAPTURE);
Expected result:
----------------
PHP fails because of brackets mismatch (one of brackets is escaped).
Actual result:
--------------
It works :(
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31357&edit=1