summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index f37918551f..4d3e44f1ec 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -700,23 +700,19 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
RETURN_FALSE;
}
- if (!php_mb_check_encoding(
- string,
- string_len,
- _php_mb_regex_mbctype2name(MBREX(current_mbctype))
- )) {
- if (array != NULL) {
- zval_dtor(array);
- array_init(array);
- }
- RETURN_FALSE;
- }
-
if (array != NULL) {
zval_dtor(array);
array_init(array);
}
+ if (!php_mb_check_encoding(
+ string,
+ string_len,
+ _php_mb_regex_mbctype2name(MBREX(current_mbctype))
+ )) {
+ RETURN_FALSE;
+ }
+
options = MBREX(regex_default_options);
if (icase) {
options |= ONIG_OPTION_IGNORECASE;