From: s dot coletta at unidata dot it
Operating system: Windows/Ubuntu
PHP version: 5.2.10
PHP Bug Type: Scripting Engine problem
Bug description: eval() parser error/warning on \'
Description:
------------
Eval() makes a wrong parsing of a string ending with \\' or \'
The "Reproduce code" will not fail if you remove the ending \\ or \ like:
$str = "define('A','C:\\Dir');"; or
$str = "define('A','C:\Dir');";
Reproduce code:
---------------
$str = "define('A','C:\\Dir\\');";
eval($str);
or
$str = "define('A','C:\Dir\');";
eval($str);
Expected result:
----------------
No warnings or errors.
Just this statement executed:
define('A','C:\Dir\');
Actual result:
--------------
For both examples provided the result is the same:
Warning: Unexpected character in input: ''' (ASCII=39) state=1 in
/test.php(3) : eval()'d code on line 1
Parse error: syntax error, unexpected ':' in /test.php(3) : eval()'d code
on line 1
--
Edit bug report at http://bugs.php.net/?id=48830&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48830&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48830&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48830&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48830&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48830&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48830&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48830&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48830&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48830&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48830&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48830&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48830&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48830&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48830&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48830&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48830&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48830&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48830&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48830&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48830&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48830&r=mysqlcfg