#23406 [NEW]: \r\n not functioning the same from 4.3.1 and prior

From: Date: Tue, 29 Apr 2003 13:03:35 +0000
Subject: #23406 [NEW]: \r\n not functioning the same from 4.3.1 and prior
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38706@lists.php.net to get a copy of this message
From: gfraley5 at earthlink dot net Operating system: Win98SE,WinXP,Win2K PHP version: 4.3.2RC2 PHP Bug Type: Filesystem function related Bug description: \r\n not functioning the same from 4.3.1 and prior This code snippet demonstrates the problem. Under 4.3.1 and prior, it functions correctly. Under 4.3.2 (all versions) it does not function the same and is actually wrong. <? $myArray[] = 'msgid'."\r\n"; $myArray[] = '1049987091'."\r\n"; $myArray[] = '1050930128'."\r\n"; $fp = fopen("problemFile.php",'w') or die("Unable to open file"); for ($i=0;$i<count($myArray);$i++) { if ($i==0) $prefx = "<? Header(\"HTTP/1.0 403 Forbidden\");exit;?>\r\n"; else $prefx = ""; fwrite($fp,$prefx.$myArray[$i]); } fclose($fp); echo nl2br(readfile("problemFile.php")); ?> Under 4.3.1 and prior, here is the output of problemFile.php: <? Header("HTTP/1.0 403 Forbidden");exit;?> msgid 1049987091 1050930128 Under 4.3.2, here is the output of problemFile.php. Notice the difference in the behaviour of the \r\n: <? Header("HTTP/1.0 403 Forbidden");exit;?> msgid 1049987091 1050930128 -- Edit bug report at http://bugs.php.net/?id=23406&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23406&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23406&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23406&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23406&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23406&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23406&r=support Expected behavior: http://bugs.php.net/fix.php?id=23406&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23406&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23406&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23406&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23406&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23406&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23406&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23406&r=gnused

« previous php.bugs (#38706) next »