hirokawa                Sat Feb 16 11:46:03 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mbstring       php_mbregex.c 
  Log:
  fixed #43994  mb_ereg 'successfully' matching incorrectly.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/php_mbregex.c?r1=1.53.2.1.2.4.2.3&r2=1.53.2.1.2.4.2.4&diff_format=u
Index: php-src/ext/mbstring/php_mbregex.c
diff -u php-src/ext/mbstring/php_mbregex.c:1.53.2.1.2.4.2.3 
php-src/ext/mbstring/php_mbregex.c:1.53.2.1.2.4.2.4
--- php-src/ext/mbstring/php_mbregex.c:1.53.2.1.2.4.2.3 Mon Dec 31 07:17:09 2007
+++ php-src/ext/mbstring/php_mbregex.c  Sat Feb 16 11:46:03 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_mbregex.c,v 1.53.2.1.2.4.2.3 2007/12/31 07:17:09 sebastian Exp $ */
+/* $Id: php_mbregex.c,v 1.53.2.1.2.4.2.4 2008/02/16 11:46:03 hirokawa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -546,6 +546,13 @@
                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;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to