summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-10-15 23:03:03 +0200
committerNikita Popov <nikic@php.net>2016-10-15 23:58:26 +0200
commitb1fc1fb9376f22693b610961a097f6d0ff6dc484 (patch)
treed209cefdd4eb9b65cc7d8d66ee8dc4282174c95b /ext/pcre/php_pcre.c
parent663491b9bac96c27d20d8e0d517182f9c9b30409 (diff)
downloadphp-git-b1fc1fb9376f22693b610961a097f6d0ff6dc484.tar.gz
Normalize preg_replace_callback() return value
One particular error case was returning the argument without casting to string.
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 ef9569b860..53e122c82b 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1584,7 +1584,7 @@ static PHP_FUNCTION(preg_replace_callback)
if (!zend_is_callable(replace, 0, &callback_name)) {
php_error_docref(NULL, E_WARNING, "Requires argument 2, '%s', to be a valid callback", ZSTR_VAL(callback_name));
zend_string_release(callback_name);
- ZVAL_COPY(return_value, subject);
+ ZVAL_STR(return_value, zval_get_string(subject));
return;
}
zend_string_release(callback_name);