From a6626eeb645d93423412461126d6514e6a756b8f Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Wed, 17 Nov 2021 14:59:18 +0530 Subject: [PATCH] Send $count param as argument so that its updated consistently. As far as I can see, this count param is not really needed, but it will still be good to keep it updated in case its getting used in an edge case that I have not considered. --- plugins/woocommerce/includes/class-wc-download-handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/class-wc-download-handler.php b/plugins/woocommerce/includes/class-wc-download-handler.php index c5241e19671..97f0961fed5 100644 --- a/plugins/woocommerce/includes/class-wc-download-handler.php +++ b/plugins/woocommerce/includes/class-wc-download-handler.php @@ -270,7 +270,7 @@ class WC_Download_Handler { ); $count = 0; - $file_path = str_replace( array_keys( $replacements ), array_values( $replacements ), $file_path ); + $file_path = str_replace( array_keys( $replacements ), array_values( $replacements ), $file_path, $count ); $parsed_file_path = wp_parse_url( $file_path ); $remote_file = null === $count || 0 === $count; // Remote file only if there were no replacements.