1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 00:53:30 +02:00

- Fix crash bug (patch by <chocolateboy@lunomail.com>)

This commit is contained in:
Derick Rethans
2001-09-24 08:33:51 +00:00
parent f3b1bc8bc2
commit f1ce7daccd

View File

@@ -2990,6 +2990,11 @@ PHP_FUNCTION(nl2br)
convert_to_string_ex(str);
/* bail out if the string is empty */
if (Z_STRLEN_PP(str) == 0) {
RETURN_EMPTY_STRING();
}
/* Windows style line-endings */
tmp = php_str_to_str((*str)->value.str.val, (*str)->value.str.len, "\r\n", 2, "<br />\r\n", 8, &new_length);
if (new_length != (*str)->value.str.len)