Make WordPress Core

Ticket #20534: 20534.5.diff

File 20534.5.diff, 1.0 KB (added by janpeters, 11 years ago)

Patch for WordPress 3.8.1

  • wp-includes/media.php

    diff --git a/wp-includes/media.php b/wp-includes/media.php
    index aac3c44..057b9ef 100644
    a b  
    551551function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
    552552
    553553        // get a thumbnail or intermediate image if there is one
    554         if ( $image = image_downsize($attachment_id, $size) )
     554        if ( $image = image_downsize($attachment_id, $size) ) {
     555                if( is_admin() ) {
     556                        $image[0] = set_url_scheme( $image[0] , 'admin' );
     557                }
     558                else {
     559                        $image[0] = set_url_scheme( $image[0] );
     560                }
    555561                return $image;
     562        }
    556563
    557564        $src = false;
    558565
     
    561568                $src_file = $icon_dir . '/' . wp_basename($src);
    562569                @list($width, $height) = getimagesize($src_file);
    563570        }
    564         if ( $src && $width && $height )
     571        if ( $src && $width && $height ) {
     572                if( is_admin() ) {
     573                        $src = set_url_scheme( $src , 'admin' );
     574                }
     575                else {
     576                        $src = set_url_scheme( $src );
     577                }
    565578                return array( $src, $width, $height );
     579        }
    566580        return false;
    567581}
    568582