[wp-trac] [WordPress Trac] #55274: Special chars in attachment filename breaks srcset

WordPress Trac noreply at wordpress.org
Mon Feb 28 10:30:37 UTC 2022


#55274: Special chars in attachment filename breaks srcset
--------------------------+------------------------
 Reporter:  dravnic       |       Owner:  audrasjb
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  6.0
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------

Comment (by dravnic):

 I was reviewing this discussion:

 https://core.trac.wordpress.org/ticket/36549

 The patches proposed here are fixing url special chars before the filter.
 This could break filter behavior if filter function expects urls that
 aren't encoded or if the filter itself changes urls and introduces special
 chars.

 The fix proposed by @joemcgill
 https://core.trac.wordpress.org/ticket/36549#comment:6
 (https://core.trac.wordpress.org/attachment/ticket/36549/36549.2.diff)
 seems better as it would escape url after the filter.

 Note that {{{esc_attr()}}} that was mentioned in the above discussion
 didn't properly encode special chars for urls. so {{{esc_url()}}} should
 be done before.

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


More information about the wp-trac mailing list