Re: Bug #11611 Updated: nl2br() outputting invalid <br> tags
| From: | Daniel Beckham | Date: | Fri, 22 Jun 2001 19:15:04 +0000 |
| Subject: | Re: Bug #11611 Updated: nl2br() outputting invalid <br> tags | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-57696@lists.php.net to get a copy of this message | ||
The short of it is that in HTML 4, it doesn't matter if you have a <br />,
<BR>, <br>, <Br> or <bR>, but in XHTML, you *must* have properly formed xml
tags. <br /> or <br></br> is the only way to validly write a "br" tag
in
xml.
So.. if the nl2br did not output <br /> you would not be able to use nl2br
in XHTML pages. Instead of limiting the function to HTML 4 pages
only.. it's now usable for HTML 4 and XHTML.
Adding an optional flag would make everyone using XHTML have to change their
code for nothing, since it doesn't actually matter for HTML 4.
Sorry if that wasn't actually the "short of it". =)
Daniel
----- Original Message -----
From: "lenar" <lenar@dotcom.ee>
To: <php-dev@lists.php.net>
Sent: Friday, June 22, 2001 8:18 AM
Subject: Re: [PHP-DEV] Bug #11611 Updated: nl2br() outputting invalid <br>
tags
Shouldn't there be an optional flag to nl2br to change the behavior of
function to what it used to be.
Just there's no point in <br /> like tags when the rest of your code is just
generating HTML compliant output,
not XHTML.
Ok, somebody can always use something like str_replace("\n", "<br>",
$text)
to get the old functionality.
lenar.
<sniper@php.net> wrote in message
news:20010622130720.29368.qmail@php2.chek.com...
> ID: 11611
> Updated by: sniper
> Reported By: nutbar@chemlab.org
> Old-Status: Closed
> Status: Bogus
> Bug Type: Strings related
> Operating system:
> PHP Version: 4.0.5
> Assigned To:
> Comments:
>
> Could this be even more bogus? :)
>
>
> Previous Comments:
> --------------------------------------------------------------------------
-
>
> [2001-06-22 04:39:51] derick@php.net
> It's XHTML compliant
>
> --------------------------------------------------------------------------
-
>
> [2001-06-21 22:13:10] nutbar@chemlab.org
> put this into a test php file:
>
> <?php
> $temp = "this isnna testn";
> 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 :)
>
> --------------------------------------------------------------------------
-
>
>
>
> ATTENTION! Do NOT reply to this email!
> To reply, use the web interface found at
http://bugs.php.net/?id=11611&edit=2
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net