From: isawhim at gmail dot com
Operating system: Linux
PHP version: 5.2.5
PHP Bug Type: Strings related
Bug description: Odd escape results from single and double quotes.
Description:
------------
Using an "Escape" \ in certain quotes, results in literal translation.
Tested on \r \n \t inside Single and Double quotes.
Single Quotes does not escape.
Double Quotes escapes.
I can not find documentation to explain this behaviour, or warnings on
pages, related to places where one might try to use an escape.
Processed all Escapes inside any single ' and double " quotes.
or...
{Possible feature request}
SingleQuoteEscape=(all|none|quotes)
DoubleQuoteEscape=(all|none|quotes)
All = \r \n \t \\ \' {\"}
None = literal quoted text, must use CHR strings (Iso), No like-quotes
allowed.
Quotes = if {'} then \' escape, if {"} then \" escape
Reproduce code:
---------------
<?
$MyString1 = '\tTest1\r\nABC1';
$MyString2 = "\tTest2\r\nABC2";
echo($MyString1.'<BR>'.$MyString2.);
?>
Expected result:
----------------
Expected Output:
Test1
ABC1
Test2
ABC2
Actual result:
--------------
Actual Output:
\tTest1\r\nABC1
Test2
ABC2
--
Edit bug report at http://bugs.php.net/?id=43531&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43531&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43531&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43531&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43531&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43531&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43531&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43531&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43531&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43531&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43531&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43531&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43531&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43531&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43531&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43531&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43531&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43531&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43531&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43531&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43531&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43531&r=mysqlcfg