Skip to content

Commit

Permalink
Update wc-rest-functions.php
Browse files Browse the repository at this point in the history
Arguments passed to end function should be passed by reference.
  • Loading branch information
jonbesga committed Jun 12, 2018
1 parent ebcdd5f commit e75c371
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/wc-rest-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/' ) ) {
Expand Down

0 comments on commit e75c371

Please sign in to comment.