summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-10-07 16:15:36 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-10-07 16:15:36 +0000
commit9b849892eacba70705fa17674f9fdb2242e6036a (patch)
treeacd6871a41512871561600424b0acd7678c223aa /ext/mbstring/php_mbregex.c
parenta8191a66c13103b2a9cbf7ad5d66c1b80164c499 (diff)
downloadphp-git-9b849892eacba70705fa17674f9fdb2242e6036a.tar.gz
MFH
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 8044d18e90..5b231212e7 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -430,15 +430,15 @@ php_mbereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, int option)
pos = 0;
while (err >= 0) {
err = mbre_search(&re, string, string_len, pos, string_len - pos, &regs);
- if ( regs.beg[0] == regs.end[0] ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
- break;
- }
if (err <= -2) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec()");
break;
}
if (err >= 0) {
+ if ( regs.beg[0] == regs.end[0] ) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ break;
+ }
/* copy the part of the string before the match */
php_mbregex_strbuf_ncat(&outdev, &string[pos], regs.beg[0] - pos);
/* copy replacement and backrefs */