Make WordPress Core

Ticket #32755: 32755.diff

File 32755.diff, 606 bytes (added by MikeHansenMe, 10 years ago)
  • src/wp-admin/includes/media.php

     
    844844                // Set variables for storage, fix file filename for query strings.
    845845                preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
    846846                $file_array = array();
     847                if ( ! isset( $matches[0] ) ) {
     848                        return new WP_Error( 'image_sideload_failed', __( 'Invalid Image URL' ) );
     849                }
    847850                $file_array['name'] = basename( $matches[0] );
    848851
    849852                // Download file to temp location.