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

WordPress Trac noreply at wordpress.org
Thu May 19 14:03:44 UTC 2016


#36549: Space in attachment filename breaks srcset
--------------------------+------------------------------
 Reporter:  underdude     |       Owner:  joemcgill
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by joemcgill):

 On second thought, we already run `srcset` attributes through `esc_attr()`
 when used in HTML elements
 ([https://core.trac.wordpress.org/browser/tags/4.5/src/wp-
 includes/media.php#L1374 see example]). That should handle all of the
 special characters besides spaces, so `esc_url()` would be needlessly
 redundant in most cases. [attachment:36549.3.diff] is essentially the same
 as [attachment:36549.diff] but moves the `str_replace()` call after the
 filter is run, which seems right to me, but is there any reason we would
 ''not'' want to run the string replace after the filter?

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


More information about the wp-trac mailing list