[wp-trac] [WordPress Trac] #54488: wp_filter_nohtml_kses does not remove HTML comments

WordPress Trac noreply at wordpress.org
Fri Feb 24 20:46:36 UTC 2023


#54488: wp_filter_nohtml_kses does not remove HTML comments
--------------------------------------------------+-----------------------
 Reporter:  leewillis77                           |       Owner:  audrasjb
     Type:  defect (bug)                          |      Status:  assigned
 Priority:  normal                                |   Milestone:  6.2
Component:  Formatting                            |     Version:  2.1
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-opinion  |     Focuses:  docs
--------------------------------------------------+-----------------------

Comment (by leewillis77):

 OK, so the two functions are different:

 {{{
 wp> wp_filter_nohtml_kses($input);
 => string(45) "body { color: red; }<!-- Comment -->Some text"
 wp> wp_strip_all_tags($input);
 => string(9) "Some text"
 }}}

 Even with the changes to the behaviour of wp_filter_nohtml_kses proposed
 here the two would still produce different results as the kses version
 does not remove the content "in" style/script tags?

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


More information about the wp-trac mailing list