Commit: c05ee74e7ff28b49018bf3e8f452bfd5386d1b68 Author: Xinchen Hui <larue...@php.net> Wed, 9 Jan 2013 10:53:20 +0800 Parents: 67c662a0a2615d52215dccc4805e8eb989df7eab Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c05ee74e7ff28b49018bf3e8f452bfd5386d1b68 Log: Fixed bug #63943 (Bad warning text from strpos() on empty needle) Bugs: https://bugs.php.net/63943 Changed paths: M NEWS M ext/standard/string.c A ext/standard/tests/strings/bug63943.phpt Diff: diff --git a/NEWS b/NEWS index ee76efb..e78af23 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 b17ad50..907301d 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 0000000..6018879 --- /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 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php