php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31357 PHP gives indulgences when a developer uses wrong escaping
Submitted: 2004-12-30 20:41 UTC Modified: 2004-12-31 00:51 UTC
From: wicked at ngs dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.8 OS: Win XP + SP1
Private report: No CVE-ID: None
 [2004-12-30 20:41 UTC] 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 :(

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-31 00:51 UTC] tony2001@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 19:01:28 2024 UTC