Ticket #34109: 34109.2.diff
File 34109.2.diff, 2.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/image-edit.php
152 152 </div> 153 153 154 154 <figure class="imgedit-thumbnail-preview"> 155 <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" />155 <img src="<?php echo set_url_scheme( $thumb['url'] ); ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" draggable="false" /> 156 156 <figcaption class="imgedit-thumbnail-preview-caption"><?php _e( 'Current thumbnail' ); ?></figcaption> 157 157 </figure> 158 158 … … 870 870 // Check if it's an image edit from attachment edit screen 871 871 if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) { 872 872 $thumb_url = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true ); 873 $return->thumbnail = $thumb_url[0];873 $return->thumbnail = set_url_scheme( $thumb_url[0] ); 874 874 } else { 875 875 $file_url = wp_get_attachment_url($post_id); 876 876 if ( ! empty( $meta['sizes']['thumbnail'] ) && $thumb = $meta['sizes']['thumbnail'] ) { -
src/wp-includes/media.php
766 766 $image = array( $src, $width, $height ); 767 767 } 768 768 } 769 770 // Change the scheme in the admin to match when either is_ssl() or force_ssl_admin(). 771 if ( $image && is_admin() ) { 772 $image[0] = set_url_scheme( $image[0], 'admin' ); 773 } 774 769 775 /** 770 776 * Filter the image src result. 771 777 * -
tests/phpunit/tests/media.php
1408 1408 1409 1409 $this->assertSame( $expected, $actual ); 1410 1410 } 1411 1412 /** 1413 * @ticket 34109 1414 */ 1415 function test_wp_get_attachment_image_src_https_admin() { 1416 // Save our starting setup. 1417 $force_ssl_admin = force_ssl_admin(); 1418 $curent_screen = get_current_screen(); 1419 1420 force_ssl_admin( true ); 1421 set_current_screen( 'dashboard' ); 1422 1423 $image = wp_get_attachment_image_src( self::$large_id ); 1424 1425 $this->assertSame( $image[0], set_url_scheme( $image[0], 'https' ) ); 1426 1427 // Leave things as we found them. 1428 force_ssl_admin( $force_ssl_admin ); 1429 $GLOBALS['current_screen'] = $curent_screen; 1430 } 1411 1431 }