diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/standard/string.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/strings/bug63943.phpt | 8 |
3 files changed, 13 insertions, 1 deletions
@@ -9,6 +9,10 @@ PHP NEWS . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). (Johannes) +- Core + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). + (Laruence) + - cURL extension: . Fixed bug (segfault due to libcurl connection caching). (Pierrick) . Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for diff --git a/ext/standard/string.c b/ext/standard/string.c index b17ad506ef..907301dfdf 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1744,7 +1744,7 @@ PHP_FUNCTION(strpos) 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; } diff --git a/ext/standard/tests/strings/bug63943.phpt b/ext/standard/tests/strings/bug63943.phpt new file mode 100644 index 0000000000..6018879b24 --- /dev/null +++ b/ext/standard/tests/strings/bug63943.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #63943 (Bad warning text from strpos() on empty needle) +--FILE-- +<?php +strpos("lllllll", ''); +?> +--EXPECTF-- +Warning: strpos(): Empty needle in %sbug63943.php on line %d |