[wp-trac] [WordPress Trac] #47244: wp_targeted_link_rel filter should not be applied to 'Custom HTML` widget

WordPress Trac noreply at wordpress.org
Thu May 16 16:36:43 UTC 2019


#47244: wp_targeted_link_rel filter should not be applied to 'Custom HTML` widget
--------------------------------------+-----------------------
 Reporter:  fierevere                 |       Owner:  audrasjb
     Type:  defect (bug)              |      Status:  assigned
 Priority:  high                      |   Milestone:  5.2.1
Component:  Widgets                   |     Version:  5.2
 Severity:  major                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by birgire):

 Thanks for the improved patch @SergeyBiryukov

 Just for reference, here are two examples that are currently not caught:

 String is split up like this:

 {{{
 document.write( '<p>Links: <a href="/" ' + "target=_blank>No rel</a></p>"
 );

 }}}

 and it will become:

 {{{
 document.write( '<p>Links: <a href="/" ' + "target=_blank rel="noopener
 noreferrer">No rel</a></p>" );

 }}}

 And this one (target and href attributes without quotes):

 {{{
 document.write( "<p>Links: <a href=/ target=_blank>No rel</a></p>" );

 }}}

 that will become:

 {{{
 document.write( "<p>Links: <a href=/ target=_blank rel="noopener
 noreferrer">No rel</a></p>" );
 }}}

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


More information about the wp-trac mailing list