diff --git src/wp-includes/media.php src/wp-includes/media.php
index 89b88df..9783b61 100644
|
|
function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon |
766 | 766 | $image = array( $src, $width, $height ); |
767 | 767 | } |
768 | 768 | } |
| 769 | |
| 770 | // Force HTTPS schemes in the admin when force_ssl_admin() is true. |
| 771 | if ( $image && is_admin() && force_ssl_admin() ) { |
| 772 | $image[0] = set_url_scheme( $image[0], 'https' ); |
| 773 | } |
| 774 | |
769 | 775 | /** |
770 | 776 | * Filter the image src result. |
771 | 777 | * |
diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
index 3da75a0..cbf3d23 100644
|
|
EOF; |
1133 | 1133 | // Intermediate sized GIFs should not include the full size in the srcset. |
1134 | 1134 | $this->assertFalse( strpos( wp_calculate_image_srcset( $size_array, $large_src, $image_meta ), $full_src ) ); |
1135 | 1135 | } |
| 1136 | |
| 1137 | /** |
| 1138 | * @ticket 34109 |
| 1139 | */ |
| 1140 | function test_wp_get_attachment_image_src_https_admin() { |
| 1141 | // Save our starting setup. |
| 1142 | $force_ssl_admin = force_ssl_admin(); |
| 1143 | $curent_screen = get_current_screen(); |
| 1144 | |
| 1145 | force_ssl_admin( true ); |
| 1146 | set_current_screen( 'dashboard' ); |
| 1147 | |
| 1148 | $image = wp_get_attachment_image_src( self::$large_id ); |
| 1149 | |
| 1150 | $this->assertSame( $image[0], set_url_scheme( $image[0], 'https' ) ); |
| 1151 | |
| 1152 | // Leave things as we found them. |
| 1153 | force_ssl_admin( $force_ssl_admin ); |
| 1154 | $GLOBALS['current_screen'] = $curent_screen; |
| 1155 | } |
1136 | 1156 | } |