From: zxc at zmail dot ru
Operating system: Windows XP build 2600
PHP version: 4.3.7
PHP Bug Type: PCRE related
Bug description: strings without \r\n
Description:
------------
I want to have strings without \r\n from my conf file.
Conf file:
#>>>> ./inc/conf.inc.dat
#>>>> key=value (with \r\n)
//Line:0>path=./user-sleepy/
//Line:1>access=moder
//Line:2>password=36Fhenw7spw
But after parsing script, the code returns strings with \r\n, why? Maybe
bug? Because i found in docs: "By default, PCRE treats the subject string
as consisting of a single "line" of characters (even if it actually
contains several newlines)".
Reproduce code:
---------------
<?
function rconf($ConfPath)
{
[EMAIL PROTECTED]($ConfPath,"r") or die("Cannot read!");
while(!feof($OpConf))
{
preg_match("/.+/",FGets($OpConf),$matches);
echo $matches[0];
}
FLock($OpConf,LOCK_EX);
FClose($OpConf);
}
rconf("./inc/conf.inc.dat");
?>
Expected result:
----------------
path=./user-sleepy/access=moderpassword=36Fhenw7spw (without \r\n)
Actual result:
--------------
path=./user-sleepy/
access=moder
password=36Fhenw7spw
--
Edit bug report at http://bugs.php.net/?id=29014&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29014&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29014&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29014&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29014&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29014&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29014&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29014&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29014&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29014&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29014&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29014&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29014&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29014&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29014&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29014&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29014&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29014&r=float