Skip to content

Commit 49ab8a4

Browse files
committed
Allow empty needle in mb_substr_count
1 parent 8dfcb6d commit 49ab8a4

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

ext/mbstring/mbstring.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,11 +2459,6 @@ PHP_FUNCTION(mb_substr_count)
24592459
RETURN_FALSE;
24602460
}
24612461

2462-
if (needle.len == 0) {
2463-
php_error_docref(NULL, E_WARNING, "Empty substring");
2464-
RETURN_FALSE;
2465-
}
2466-
24672462
n = mbfl_substr_count(&haystack, &needle);
24682463
if (!mbfl_is_error(n)) {
24692464
RETVAL_LONG(n);

0 commit comments

Comments
 (0)