From:             steve1011 at att dot net
Operating system: Windows 2003 server
PHP version:      5.2.5
PHP Bug Type:     Scripting Engine problem
Bug description:  Line Continuation Characters inside string are being removed

Description:
------------
If a string contains backslash newline, in any form of input or string
building, those characters are removed as if the parser is processing a
script line. All other languages that I know of only remove the line
continuation if it occurs outside of a string definition and leaves the
inside of strings alone (other than normal escape sequences of double
quoted strings). php even strips the backslash newline from text submitted
through a web form and referenced as $_REQUEST['varname'].

Line continuation characters effected are:

backslash newline
backslash carriage return
backslash equal sign
backslash 0x10

There may be more. I haven't completed testing yet, but will update this
bug report if I find more.

Reproduce code:
---------------
I've tried test strings (letter e, backslash, newline, letter e) like:

"e\\\ne" becomes "ee"
'e\'."\n".'e' becomes 'ee'
'e\'.0x0a.'e' becomes 'ee'
"e\\\x0ae" becomes "ee"

you get the idea.

If I [sic] escape the string like this:

"e\\\\\x0a\x0ae" I get the expected [e, backslash, newline, e] string.



-- 
Edit bug report at http://bugs.php.net/?id=43811&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43811&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43811&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43811&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43811&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43811&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43811&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43811&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43811&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43811&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43811&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43811&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43811&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43811&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43811&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43811&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43811&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43811&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43811&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43811&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43811&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43811&r=mysqlcfg

Reply via email to