summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-01-09 10:53:20 +0800
committerXinchen Hui <laruence@php.net>2013-01-09 10:53:20 +0800
commitc05ee74e7ff28b49018bf3e8f452bfd5386d1b68 (patch)
treed0e57bb8482ca0697d4ef11d70f124332db339f4
parent67c662a0a2615d52215dccc4805e8eb989df7eab (diff)
downloadphp-git-c05ee74e7ff28b49018bf3e8f452bfd5386d1b68.tar.gz
Fixed bug #63943 (Bad warning text from strpos() on empty needle)
-rw-r--r--NEWS4
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/standard/tests/strings/bug63943.phpt8
3 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index ee76efb3a3..e78af2339d 100644
--- a/NEWS
+++ b/NEWS
@@ -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