Ticket #32746: 32746.diff
| File 32746.diff, 1.6 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/js/media/models/attachments.js
493 493 type: function( attachment ) { 494 494 var type = this.props.get('type'), atts = attachment.toJSON(), mime, found; 495 495 496 if ( ! type || ( _.isArray( type ) && ! type.length ) ) { 497 return true; 498 } 499 496 500 mime = atts.mime || ( atts.file && atts.file.type ) || ''; 497 501 498 502 if ( _.isArray( type ) ) { 499 found = ! type.length ||_.find( type, function (t) {503 found = _.find( type, function (t) { 500 504 return -1 !== mime.indexOf( t ); 501 505 } ); 502 506 } else { 503 found = ! type ||-1 !== mime.indexOf( type );507 found = -1 !== mime.indexOf( type ); 504 508 } 505 509 506 510 return found; -
src/wp-includes/js/media-models.js
897 897 type: function( attachment ) { 898 898 var type = this.props.get('type'), atts = attachment.toJSON(), mime, found; 899 899 900 if ( ! type || ( _.isArray( type ) && ! type.length ) ) { 901 return true; 902 } 903 900 904 mime = atts.mime || ( atts.file && atts.file.type ) || ''; 901 905 902 906 if ( _.isArray( type ) ) { 903 found = ! type.length ||_.find( type, function (t) {907 found = _.find( type, function (t) { 904 908 return -1 !== mime.indexOf( t ); 905 909 } ); 906 910 } else { 907 found = ! type ||-1 !== mime.indexOf( type );911 found = -1 !== mime.indexOf( type ); 908 912 } 909 913 910 914 return found;