From: Stanislav Malyshev Date: Mon, 23 Jun 2003 14:09:14 +0000 (+0000) Subject: Fix #24281 - str_replace not updating the count if value is X-Git-Tag: RELEASE_1_0_2~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baa3892fe1539a85294127c256c5c9dc83c1c975;p=php Fix #24281 - str_replace not updating the count if value is not initialized --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 46194042c9..3203675120 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3194,7 +3194,8 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit php_str_replace_in_subject(*search, *replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL); } if (argc > 3) { - Z_LVAL_PP(zcount) = count; + zval_dtor(*zcount); + ZVAL_LONG(*zcount, count); } } /* }}} */