moriyoshi Wed Oct 30 05:35:55 2002 EDT Modified files: /php4/ext/mbstring php_mbregex.c Log: Fixed mb_ereg_replace() bug Index: php4/ext/mbstring/php_mbregex.c diff -u php4/ext/mbstring/php_mbregex.c:1.16 php4/ext/mbstring/php_mbregex.c:1.17 --- php4/ext/mbstring/php_mbregex.c:1.16 Sun Oct 20 11:11:04 2002 +++ php4/ext/mbstring/php_mbregex.c Wed Oct 30 05:35:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mbregex.c,v 1.16 2002/10/20 15:11:04 moriyoshi Exp $ */ +/* $Id: php_mbregex.c,v 1.17 2002/10/30 10:35:55 moriyoshi Exp $ */ #ifdef HAVE_CONFIG_H @@ -496,10 +496,12 @@ break; } if (err >= 0) { +#if moriyoshi_0 if ( regs.beg[0] == regs.end[0] ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); break; } +#endif /* copy the part of the string before the match */ _php_mb_regex_strbuf_ncat(&outdev, &string[pos], regs.beg[0] - pos); /* copy replacement and backrefs */ @@ -540,6 +542,7 @@ if (pos < n) { pos = n; } else { + _php_mb_regex_strbuf_ncat(&outdev, &string[pos], 1 ); pos++; } } else { /* nomatch */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php