Browse Source

Fixed bug #64432 (more empty delimiter warning in strX methods)

PHP-5.4.14
Xinchen Hui 13 years ago
parent
commit
0fd3572f4e
  1. 1
      NEWS
  2. 4
      ext/standard/string.c
  3. 4
      ext/standard/tests/strings/stristr_error.phpt
  4. BIN
      ext/standard/tests/strings/strstr.phpt

1
NEWS

@ -2,6 +2,7 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.4.14
- Core
. Fixed bug #64432 (more empty delimiter warning in strX methods). (Laruence)
. Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error).
(Dmitry)
. Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).

4
ext/standard/string.c

@ -1715,7 +1715,7 @@ PHP_FUNCTION(stristr)
if (Z_TYPE_P(needle) == IS_STRING) {
char *orig_needle;
if (!Z_STRLEN_P(needle)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
efree(haystack_dup);
RETURN_FALSE;
}
@ -1765,7 +1765,7 @@ PHP_FUNCTION(strstr)
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
RETURN_FALSE;
}

4
ext/standard/tests/strings/stristr_error.phpt

@ -50,11 +50,11 @@ NULL
-- Testing stristr() function with empty haystack --
Warning: stristr(): Empty delimiter in %s on line %d
Warning: stristr(): Empty needle in %s on line %d
bool(false)
-- Testing stristr() function with empty needle --
Warning: stristr(): Empty delimiter in %s on line %d
Warning: stristr(): Empty needle in %s on line %d
bool(false)
===DONE===

BIN
ext/standard/tests/strings/strstr.phpt

Loading…
Cancel
Save