From 3e7cb1286f1c06daa6f5eacc7bb6053fefee1665 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 6 Jul 2004 22:16:47 +0000 Subject: [PATCH] MFH: Fixed bug #29034 (wordwrap() returns a boolean when passed empty string). --- NEWS | 2 ++ ext/standard/string.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 2383d570ab..1cd388a3f3 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP 4 NEWS - Updated PCRE to provide better error handling in certain cases. (Andrei) - NSAPI: added "bucket" parameter to list of non-php.ini-keys of php4_execute for doing performance stats without warnings in server-log. (Uwe Schindler) +- Fixed bug #29034 (wordwrap() returns a boolean when passed empty string). + (Ilia) - Fixed bug #28963 (Missing space for \0 in address allocation). (Ilia) - Fixed bug #28897 (ibase: -1 returned as -0.000 for 64-bit scaled int). (Ard) - Fixed bug #28879 (Implicit/Explicit array creation inconsistency when using diff --git a/ext/standard/string.c b/ext/standard/string.c index 83992dbc3e..25d061a107 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -637,8 +637,9 @@ PHP_FUNCTION(wordwrap) return; } - if (textlen == 0) - RETURN_FALSE; + if (textlen == 0) { + RETURN_EMPTY_STRING(); + } if (linelength == 0 && docut) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero."); -- 2.40.0