From:             wicked at ngs dot ru
Operating system: Win XP + SP1
PHP version:      4.3.8
PHP Bug Type:     Scripting Engine problem
Bug description:  PHP gives indulgences when a developer uses wrong escaping

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 bug report at http://bugs.php.net/?id=31357&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31357&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31357&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31357&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31357&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31357&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31357&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31357&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31357&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31357&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31357&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31357&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31357&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31357&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31357&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31357&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31357&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31357&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31357&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31357&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31357&r=mysqlcfg

Reply via email to