WordPress.org

Make WordPress Core

Ticket #36549: 36549.diff

File 36549.diff, 665 bytes (added by underdude, 4 years ago)

Patch to fix the problem

  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index 9f35f79..e54a5da 100644
    function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac 
    11091109                if ( abs( $constrained_size[0] - $expected_size[0] ) <= 1 && abs( $constrained_size[1] - $expected_size[1] ) <= 1 ) {
    11101110                        // Add the URL, descriptor, and value to the sources array to be returned.
    11111111                        $source = array(
    1112                                 'url'        => $image_baseurl . $image['file'],
     1112                                'url'        => $image_baseurl . str_replace(' ', '%20', $image['file']),
    11131113                                'descriptor' => 'w',
    11141114                                'value'      => $image['width'],
    11151115                        );