PHP 4.0 Bug #8390: nl2br generates bad tag

From: Date: Sat, 23 Dec 2000 23:49:15 +0000
Subject: PHP 4.0 Bug #8390: nl2br generates bad tag
Groups: php.dev 
Request: Send a blank email to php-dev+get-42189@lists.php.net to get a copy of this message
From: anil@recoil.org Operating system: OpenBSD PHP version: 4.0.4 PHP Bug Type: Feature/Change Request Bug description: nl2br generates bad tag Right now, it's impossible to generate valid XHTML by using the nl2br() command, as it outputs a <br> tag. It would be nice to change this to output a <br /> tag instead, which is fully backward compatible afaik, and also valid XML (and hence XHTML). Here's an extremely complicated patch that should hopefully accomplish this :-) --- ext/standard/string.c.orig Sat Dec 23 23:39:06 2000 +++ ext/standard/string.c Sat Dec 23 23:40:48 2000 @@ -2304,7 +2304,7 @@ PHP_FUNCTION(nl2br) convert_to_string_ex(str); - php_char_to_str((*str)->value.str.val,(*str)->value.str.len,'\n',"<br>\n",5,return_value); + php_char_to_str((*str)->value.str.val,(*str)->value.str.len,'\n',"<br />\n",7,return_value); } /* }}} */ -- Edit Bug report at: http://bugs.php.net/?id=8390&edit=1

« previous php.dev (#42189) next »