]> granicus.if.org Git - php/commitdiff
Fixed reference arg hanlding in pcre_replace
authorXinchen Hui <laruence@gmail.com>
Sun, 16 Mar 2014 00:45:43 +0000 (08:45 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 16 Mar 2014 00:45:43 +0000 (08:45 +0800)
ext/pcre/php_pcre.c

index 3c60a6a3e4bf478a28a9c74700efcdcdb52d523a..969fce2e9e1b1a96e6fda8d04722614154feaae9 100644 (file)
@@ -1392,6 +1392,9 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
                }
        }
        if (ZEND_NUM_ARGS() > 4) {
+               if (Z_ISREF_P(zcount)) {
+                       zcount = Z_REFVAL_P(zcount);
+               }
                zval_dtor(zcount);
                ZVAL_LONG(zcount, replace_count);
        }