diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-10-30 10:35:55 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2002-10-30 10:35:55 +0000 |
commit | 45361297f355fa979cb588f6b09d7a2c5e1a9814 (patch) | |
tree | f4dd0e4e65a9366f45ed21031bf421167f76f713 /ext/mbstring/php_mbregex.c | |
parent | a705a8b597203f476aecdadf1e455a9b46730609 (diff) | |
download | php-git-45361297f355fa979cb588f6b09d7a2c5e1a9814.tar.gz |
Fixed mb_ereg_replace() bug
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r-- | ext/mbstring/php_mbregex.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 46aafd0c41..d85201d03b 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -496,10 +496,12 @@ _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, int option) 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 @@ _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, int option) if (pos < n) { pos = n; } else { + _php_mb_regex_strbuf_ncat(&outdev, &string[pos], 1 ); pos++; } } else { /* nomatch */ |