Skip to content

Commit 7973e72

Browse files
committed
Separate parameter of grapheme_strstr and grapheme_stristr
1 parent e3237bb commit 7973e72

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

ext/intl/grapheme/grapheme_string.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,23 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
547547
int32_t ret_pos, uchar_pos;
548548
bool part = false;
549549

550-
ZEND_PARSE_PARAMETERS_START(2, 4)
551-
Z_PARAM_STRING(haystack, haystack_len)
552-
Z_PARAM_STRING(needle, needle_len)
553-
Z_PARAM_OPTIONAL
554-
Z_PARAM_BOOL(part)
555-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
556-
ZEND_PARSE_PARAMETERS_END();
550+
if (f_ignore_case == 1) {
551+
ZEND_PARSE_PARAMETERS_START(2, 4)
552+
Z_PARAM_STRING(haystack, haystack_len)
553+
Z_PARAM_STRING(needle, needle_len)
554+
Z_PARAM_OPTIONAL
555+
Z_PARAM_BOOL(part)
556+
Z_PARAM_STRING_OR_NULL(locale, locale_len)
557+
ZEND_PARSE_PARAMETERS_END();
558+
} else {
559+
ZEND_PARSE_PARAMETERS_START(2, 3)
560+
Z_PARAM_STRING(haystack, haystack_len)
561+
Z_PARAM_STRING(needle, needle_len)
562+
Z_PARAM_OPTIONAL
563+
Z_PARAM_BOOL(part)
564+
Z_PARAM_STRING_OR_NULL(locale, locale_len)
565+
ZEND_PARSE_PARAMETERS_END();
566+
}
557567

558568
if ( !f_ignore_case ) {
559569

0 commit comments

Comments
 (0)