php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11611 nl2br() outputting invalid <br> tags
Submitted: 2001-06-21 22:13 UTC Modified: 2004-10-13 22:40 UTC
From: nutbar at chemlab dot org Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.5 OS: Linux Slackware current 2.4.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nutbar at chemlab dot org
New email:
PHP Version: OS:

 

 [2001-06-21 22:13 UTC] nutbar at chemlab dot org
put this into a test php file:

<?php
	$temp = "this is\n\na test\n";
	printf("%s", nl2br($temp));
?>

and you should get this as output from your webserver:

this is<br />
<br />
a test<br />

I have confirmed this to be also an issue in the 4.0.6 release candidates, but I do not know when this all of a sudden became an issue.  I'd like to know why it's creating <br /> tags instead of <br> tags :)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 04:39 UTC] derick@php.net
It's XHTML compliant
 [2001-06-22 09:07 UTC] sniper@php.net
Could this be even more bogus? :)

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 03:01:25 2019 UTC