From e75c3716d2217435a922bcc0b950abb964bb50b9 Mon Sep 17 00:00:00 2001 From: Jon Besga Date: Tue, 12 Jun 2018 12:45:22 +0100 Subject: [PATCH] Update wc-rest-functions.php Arguments passed to end function should be passed by reference. --- includes/wc-rest-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/wc-rest-functions.php b/includes/wc-rest-functions.php index fc10d884b4c..253f914023b 100644 --- a/includes/wc-rest-functions.php +++ b/includes/wc-rest-functions.php @@ -102,7 +102,8 @@ function wc_rest_upload_image_from_url( $image_url ) { if ( ! $wp_filetype['type'] ) { $headers = wp_remote_retrieve_headers( $response ); if ( isset( $headers['content-disposition'] ) && strstr( $headers['content-disposition'], 'filename=' ) ) { - $disposition = end( explode( 'filename=', $headers['content-disposition'] ) ); + $content = explode( 'filename=', $headers['content-disposition'] ); + $disposition = end( $content ); $disposition = sanitize_file_name( $disposition ); $file_name = $disposition; } elseif ( isset( $headers['content-type'] ) && strstr( $headers['content-type'], 'image/' ) ) {