Changeset 34255
- Timestamp:
- 09/17/2015 12:36:12 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/post-functions.php (modified) (1 diff)
-
tests/phpunit/tests/post/attachments.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-functions.php
r34248 r34255 5082 5082 5083 5083 foreach ( $matches as $match => $wilds ) { 5084 if ( isset($types[$wilds[0]])) { 5085 $icon = $types[$wilds[0]]; 5086 if ( !is_numeric($mime) ) 5087 wp_cache_add("mime_type_icon_$mime", $icon); 5088 break; 5084 foreach ( $wilds as $wild ) { 5085 if ( ! isset( $types[ $wild ] ) ) { 5086 continue; 5087 } 5088 5089 $icon = $types[ $wild ]; 5090 if ( ! is_numeric( $mime ) ) { 5091 wp_cache_add( "mime_type_icon_$mime", $icon ); 5092 } 5093 break 2; 5089 5094 } 5090 5095 } -
trunk/tests/phpunit/tests/post/attachments.php
r33188 r34255 513 513 $upload = wp_upload_bits( basename( $filename ), null, $contents ); 514 514 515 remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) ); 516 515 517 $this->assertNotEmpty( $upload['error'] ); 516 517 remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );518 518 } 519 519 … … 527 527 return $mimes; 528 528 } 529 530 /** 531 * @ticket 33012 532 */ 533 public function test_wp_mime_type_icon() { 534 $icon = wp_mime_type_icon(); 535 536 $this->assertContains( 'images/media/default.png', $icon ); 537 } 538 539 /** 540 * @ticket 33012 541 */ 542 public function test_wp_mime_type_icon_video() { 543 $icon = wp_mime_type_icon( 'video/mp4' ); 544 545 $this->assertContains( 'images/media/video.png', $icon ); 546 } 529 547 }
Note: See TracChangeset
for help on using the changeset viewer.