[wp-trac] [WordPress Trac] #36549: Space in attachment filename breaks srcset

WordPress Trac noreply at wordpress.org
Wed Jul 13 15:23:28 UTC 2016

#36549: Space in attachment filename breaks srcset
 Reporter:  underdude         |       Owner:  joemcgill
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.6
Component:  Media             |     Version:  4.4
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
Changes (by joemcgill):

 * status:  reviewing => closed
 * resolution:   => fixed


 In [changeset:"38052"]:
 #!CommitTicketReference repository="" revision="38052"
 Media: URL encode spaces in `srcset` attributes.

 In some cases, images in the media library may contain spaces in
 their filenames. This results in an invalid `srcset` attribute,
 causing broken images on the front end. This change fixes the issue
 by replacing spaces in URLs with URL encoded '%20' characters before
 returning the `srcset` string.

 Props underdude, joemcgill.
 Fixes #36549.

Ticket URL: <https://core.trac.wordpress.org/ticket/36549#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list