Skip to content

Commit e357f67

Browse files
committed
Remove code duplication
And fix indentation
1 parent 8e2f082 commit e357f67

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

ext/mbstring/php_mbregex.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -700,23 +700,19 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
700700
RETURN_FALSE;
701701
}
702702

703-
if (!php_mb_check_encoding(
704-
string,
705-
string_len,
706-
_php_mb_regex_mbctype2name(MBREX(current_mbctype))
707-
)) {
708-
if (array != NULL) {
709-
zval_dtor(array);
710-
array_init(array);
711-
}
712-
RETURN_FALSE;
713-
}
714-
715703
if (array != NULL) {
716704
zval_dtor(array);
717705
array_init(array);
718706
}
719707

708+
if (!php_mb_check_encoding(
709+
string,
710+
string_len,
711+
_php_mb_regex_mbctype2name(MBREX(current_mbctype))
712+
)) {
713+
RETURN_FALSE;
714+
}
715+
720716
options = MBREX(regex_default_options);
721717
if (icase) {
722718
options |= ONIG_OPTION_IGNORECASE;

0 commit comments

Comments
 (0)