summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-16 14:32:33 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-16 14:32:33 +0200
commitbbe74a6e3a6f83d3ff5108aa09c6a16699e5123f (patch)
tree3f56932c47d4ea2c20fd0ff6c34591356c4a1e65 /ext/mbstring/php_mbregex.c
parent77d0587fdbfdd89c901e695cf6f61659c19edaa8 (diff)
parent3f2f36d5d4c5c3c77703b366a5c7f9c3682727ee (diff)
downloadphp-git-bbe74a6e3a6f83d3ff5108aa09c6a16699e5123f.tar.gz
Merge branch 'PHP-7.4'
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index bc36596988..c614b0d5a4 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1357,7 +1357,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
size_t n, i, pos, len;
/* Stored as int* in the OnigRegion struct */
int beg, end;
- OnigOptionType option;
+ OnigOptionType option = 0;
OnigUChar *str;
OnigSyntaxType *syntax;
@@ -1365,11 +1365,11 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_THROWS();
}
- option = MBREX(regex_default_options);
-
if (arg_options) {
- option = 0;
_php_mb_regex_init_options(arg_options, arg_options_len, &option, &syntax, NULL);
+ } else {
+ option |= MBREX(regex_default_options);
+ syntax = MBREX(regex_default_syntax);
}
if (MBREX(search_regs)) {
@@ -1379,7 +1379,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (arg_pattern) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(regex_default_syntax))) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, syntax)) == NULL) {
RETURN_FALSE;
}
}