mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
MFB: Fixed "Floating point exception" inside wordwrap()
This commit is contained in:
parent
6b7c17e222
commit
7bfd857fa1
@ -856,6 +856,11 @@ PHP_FUNCTION(wordwrap)
|
||||
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;
|
||||
|
@ -27,6 +27,8 @@ $tests = <<<TESTS
|
||||
|
||||
"123|==1234567890|==123" === wordwrap("123 1234567890 123", 10, "|==", 1)
|
||||
|
||||
FALSE === @wordwrap(chr(0), 0, "")
|
||||
|
||||
TESTS;
|
||||
|
||||
include(dirname(__FILE__) . '/../../../../tests/quicktester.inc');
|
||||
|
Loading…
Reference in New Issue
Block a user