summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-11 12:32:38 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-02-11 12:32:38 +0100
commit5702ce630b0998456b22fc22576d7946efc67988 (patch)
tree2a7a88ffbf30c37fa9141bba38e057a8ce98f6b3 /ext/mbstring/php_mbregex.c
parentc9ab1078ccd189891d3032a8741b7f108dc3b624 (diff)
parentf5d2a3046656ee51cfe8b2b450230e20a7e019a1 (diff)
downloadphp-git-5702ce630b0998456b22fc22576d7946efc67988.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, 10 insertions, 0 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 82ed0c1be2..0f1b93f536 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1228,6 +1228,11 @@ PHP_FUNCTION(mb_split)
count--;
}
+ if (!php_mb_check_encoding(string, string_len,
+ _php_mb_regex_mbctype2name(MBREX(current_mbctype)))) {
+ RETURN_FALSE;
+ }
+
/* create regex pattern buffer */
if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
@@ -1317,6 +1322,11 @@ PHP_FUNCTION(mb_ereg_match)
}
}
+ if (!php_mb_check_encoding(string, string_len,
+ _php_mb_regex_mbctype2name(MBREX(current_mbctype)))) {
+ RETURN_FALSE;
+ }
+
if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}