WordPress.org

Make WordPress Core

Ticket #28932: 28932.1.diff

File 28932.1.diff, 538 bytes (added by danielbachhuber, 7 years ago)
  • wp-admin/includes/media.php

     
    809809 */
    810810function media_sideload_image( $file, $post_id, $desc = null ) {
    811811        if ( ! empty( $file ) ) {
     812
     813                $file_array = array();
     814
    812815                // Set variables for storage, fix file filename for query strings.
    813816                preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
    814817                $file_array['name'] = basename( $matches[0] );