summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-12-21 18:09:59 +0800
committerXinchen Hui <laruence@gmail.com>2015-12-21 18:10:48 +0800
commit817513af4ec5e5a45fdd7ecd0a00e728d00c3ff3 (patch)
treef907f52af4b15852eb43d2aa29bacf46f4967440 /ext/pcre/php_pcre.c
parentc85f569e5248893539c129e867896db56e1eff28 (diff)
downloadphp-git-817513af4ec5e5a45fdd7ecd0a00e728d00c3ff3.tar.gz
Fixed bug #71178 (preg_replace with arrays creates [0] in replace array if not already set)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 66ee238dc4..6769eb7d9a 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1380,7 +1380,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
/* Get current entry */
replace_entry = NULL;
while (replace_idx < Z_ARRVAL_P(replace)->nNumUsed) {
- if (Z_TYPE(Z_ARRVAL_P(replace)->arData[replace_idx].val) != IS_UNUSED) {
+ if (Z_TYPE(Z_ARRVAL_P(replace)->arData[replace_idx].val) != IS_UNDEF) {
replace_entry = &Z_ARRVAL_P(replace)->arData[replace_idx].val;
break;
}