Ticket #22796: 22796.diff
File 22796.diff, 830 bytes (added by , 12 years ago) |
---|
-
wp-includes/js/media-views.js
787 787 scanImage: function( attributes ) { 788 788 var frame = this.frame, 789 789 state = this, 790 url = this.props.get('url') ,790 url = this.props.get('url') || '', 791 791 image = new Image(); 792 792 793 793 // Try to load the image and find its width/height. … … 805 805 image.src = url; 806 806 807 807 // Check if the URL looks like an image; skew toward success. 808 url = url.replace( /([?|#].*)$/, '' );809 if ( /\.(png|jpe?g|gif)$/i.test( url ) )808 // Trims query parameters and hash components. 809 if ( /\.(png|jpe?g|gif)$/i.test( url.replace( /([?|#].*)$/, '' ) ) ) 810 810 attributes.type = 'image'; 811 811 }, 812 812