Ticket #31352: 31352.follow.diff
File 31352.follow.diff, 4.5 KB (added by , 11 months ago) |
---|
-
src/wp-includes/media.php
978 978 /** This filter is documented in wp-includes/post.php */ 979 979 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 980 980 981 $src_file = $icon_dir . '/' . wp_basename( $src ); 982 list( $width, $height ) = wp_getimagesize( $src_file ); 981 $src_file = $icon_dir . '/' . wp_basename( $src ); 982 $ext = strtolower( substr( $src_file, -4 ) ); 983 if ( '.svg' === $ext ) { 984 // SVG doesn't have true dimensions, so we assign width and height directly. 985 $width = 48; 986 $height = 64; 987 } else { 988 list( $width, $height ) = wp_getimagesize( $src_file ); 989 } 983 990 } 984 991 } 985 992 -
tests/phpunit/tests/media.php
399 399 $this->assertSame( '', $prepped['subtype'] ); 400 400 // #21963, there will be a GUID always, so there will be a URL. 401 401 $this->assertNotEquals( '', $prepped['url'] ); 402 $this->assertSame( site_url( 'wp-includes/images/media/default. png' ), $prepped['icon'] );402 $this->assertSame( site_url( 'wp-includes/images/media/default.svg' ), $prepped['icon'] ); 403 403 404 404 // Fake a mime. 405 405 $post->post_mime_type = 'image/jpeg'; -
tests/phpunit/tests/post/attachments.php
508 508 public function test_wp_mime_type_icon() { 509 509 $icon = wp_mime_type_icon(); 510 510 511 $this->assertStringContainsString( 'images/media/default. png', $icon );511 $this->assertStringContainsString( 'images/media/default.svg', $icon ); 512 512 } 513 513 514 514 /** … … 517 517 public function test_wp_mime_type_icon_video() { 518 518 $icon = wp_mime_type_icon( 'video/mp4' ); 519 519 520 $this->assertStringContainsString( 'images/media/video. png', $icon );520 $this->assertStringContainsString( 'images/media/video.svg', $icon ); 521 521 } 522 522 }