]> granicus.if.org Git - php/commitdiff
fix empty string check
authorAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 09:23:23 +0000 (11:23 +0200)
committerAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 09:23:23 +0000 (11:23 +0200)
ext/mbstring/php_mbregex.c

index 864d50a5ceb4ae0513faa8243020b5a7f897300d..62b3e962f6abd99c448aec3e69ce09b50677e418 100644 (file)
@@ -717,7 +717,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
                /* don't bother doing an extended regex with just a number */
        }
 
-       if (!Z_STRVAL_P(arg_pattern) || Z_STRLEN_P(arg_pattern) == 0) {
+       if (!Z_STRVAL_P(arg_pattern)[0] || Z_STRLEN_P(arg_pattern) == 0) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
                RETVAL_FALSE;
                goto out;