Ticket #22740: 22740.diff
| File 22740.diff, 731 bytes (added by koopersmith, 6 months ago) |
|---|
-
wp-includes/js/media-views.js
761 761 url = this.props.get('url'), 762 762 image = new Image(); 763 763 764 // Try to load the image and find its width/height. 764 765 image.onload = function() { 765 766 if ( state !== frame.state() || url !== state.props.get('url') ) 766 767 return; … … 773 774 }; 774 775 775 776 image.src = url; 777 778 // Check if the URL looks like an image; skew toward success. 779 url = url.replace( /([?|#].*)$/, '' ); 780 if ( /\.(png|jpe?g|gif)$/i.test( url ) ) 781 attributes.type = 'image'; 776 782 }, 777 783 778 784 refresh: function() {
