1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00

fixed #43994 mb_ereg 'successfully' matching incorrectly.

This commit is contained in:
Rui Hirokawa
2008-02-16 11:46:03 +00:00
parent 179b370957
commit ad400f1144
+7
View File
@@ -546,6 +546,13 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
convert_to_string_ex(arg_pattern);
/* don't bother doing an extended regex with just a number */
}
if (!Z_STRVAL_PP(arg_pattern) || Z_STRLEN_PP(arg_pattern) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
RETVAL_FALSE;
goto out;
}
re = php_mbregex_compile_pattern(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern), options, MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC);
if (re == NULL) {
RETVAL_FALSE;