Skip to content

Commit c05ee74

Browse files
committed
Fixed bug #63943 (Bad warning text from strpos() on empty needle)
1 parent 67c662a commit c05ee74

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ PHP NEWS
99
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
1010
(Johannes)
1111

12+
- Core
13+
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
14+
(Laruence)
15+
1216
- cURL extension:
1317
. Fixed bug (segfault due to libcurl connection caching). (Pierrick)
1418
. Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ PHP_FUNCTION(strpos)
17441744

17451745
if (Z_TYPE_P(needle) == IS_STRING) {
17461746
if (!Z_STRLEN_P(needle)) {
1747-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
1747+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
17481748
RETURN_FALSE;
17491749
}
17501750

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--TEST--
2+
Bug #63943 (Bad warning text from strpos() on empty needle)
3+
--FILE--
4+
<?php
5+
strpos("lllllll", '');
6+
?>
7+
--EXPECTF--
8+
Warning: strpos(): Empty needle in %sbug63943.php on line %d

0 commit comments

Comments
 (0)