#19922 [Csd->Opn]: nl2br() fails for not empty strings without newline.
| From: | nicos@php.net | Date: | Tue, 15 Oct 2002 18:22:42 +0000 |
| Subject: | #19922 [Csd->Opn]: nl2br() fails for not empty strings without newline. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22508@lists.php.net to get a copy of this message | ||
ID: 19922
Updated by: nicos@php.net
Reported By: andreas.rieber@2e-systems.com
-Status: Closed
+Status: Open
Bug Type: Strings related
-Operating System: Linux
+Operating System: FreeBSD
PHP Version: 4.3.0-pre1
New Comment:
This bug is verified if there is no such \n it outputs something
strange not even ISO.
Previous Comments:
------------------------------------------------------------------------
[2002-10-15 12:53:28] iliaa@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-10-15 12:44:41] andreas.rieber@2e-systems.com
The nl2br() function output is messed up, if the string is not empty
but has no newline.
testfile:
-----------------------------------------------------
--TEST--
Testing nl2br()
--FILE--
<?php
$stringa = "without newline";
$stringb = "with\nnewline";
echo nl2br( $stringa), "\n";
echo nl2br( $stringb), "\n";
?>
--EXPECT--
without newline
with
newline
log of test:
-----------------------------------------------------
---- EXPECTED OUTPUT
without newline
with
newline
---- ACTUAL OUTPUT
A ...(binay data can't copy :-)
with<br />
newline
---- FAILED
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19922&edit=1