iliaa Sun Jul 22 15:55:16 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard string.c /php-src/ext/standard/tests/strings wordwrap.phpt /php-src NEWS Log: Fixed "Floating point exception" inside wordwrap() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.63&r2=1.445.2.14.2.64&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.63 php-src/ext/standard/string.c:1.445.2.14.2.64 --- php-src/ext/standard/string.c:1.445.2.14.2.63 Wed Jun 6 21:53:54 2007 +++ php-src/ext/standard/string.c Sun Jul 22 15:55:15 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.445.2.14.2.63 2007/06/06 21:53:54 tony2001 Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.64 2007/07/22 15:55:15 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -653,6 +653,11 @@ RETURN_EMPTY_STRING(); } + if (breakcharlen == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Break string cannot be empty"); + RETURN_FALSE; + } + if (linelength == 0 && docut) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero."); RETURN_FALSE; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/wordwrap.phpt?r1=1.7&r2=1.7.6.1&diff_format=u Index: php-src/ext/standard/tests/strings/wordwrap.phpt diff -u php-src/ext/standard/tests/strings/wordwrap.phpt:1.7 php-src/ext/standard/tests/strings/wordwrap.phpt:1.7.6.1 --- php-src/ext/standard/tests/strings/wordwrap.phpt:1.7 Wed May 19 08:45:23 2004 +++ php-src/ext/standard/tests/strings/wordwrap.phpt Sun Jul 22 15:55:16 2007 @@ -27,6 +27,8 @@ "123|==1234567890|==123" === wordwrap("123 1234567890 123", 10, "|==", 1) +FALSE === @wordwrap(chr(0), 0, "") + TESTS; include(dirname(__FILE__) . '/../../../../tests/quicktester.inc'); http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.842&r2=1.2027.2.547.2.843&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.842 php-src/NEWS:1.2027.2.547.2.843 --- php-src/NEWS:1.2027.2.547.2.842 Fri Jul 20 10:53:56 2007 +++ php-src/NEWS Sun Jul 22 15:55:16 2007 @@ -34,6 +34,8 @@ - Implemented FR #41884 (ReflectionClass::getDefaultProperties() does not handle static attributes). (Tony) +- Fixed "Floating point exception" inside wordwrap(). (Mattias Bengtsson, + Ilia) - Fixed crash in OpenSSL extension because of non-string passphrase. (Dmitry) - Fixed var_export() to use the new H modifier so that it can generate parseable PHP code for floats, independent of the locale. (Derick)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php