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

WordPress Trac noreply at wordpress.org
Tue Feb 28 22:02:06 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.3
Component:  Formatting                            |     Version:  2.1
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-opinion  |     Focuses:  docs
--------------------------------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:21 peterwilsoncc]:
 > One functional difference I've noticed with kses is that it's possible
 to filter the allowed HTML for the strip context

 Yes, also a plugin may return an empty array from any of the instances of
 the `wp_kses_allowed_html` filter.

 > Were the kses approach to be deprecated in favour of
 `wp_strip_all_tags()` then I'd suggest modifying `wp_kses()` to use the
 function if the allowed HTML is an empty array.

 +1. Then perhaps there will be no need to deprecate
 `wp_filter_nohtml_kses()`. Only change the docs to explain that it is a
 shortcut for `wp_kses()` without any allowed tags and the latter uses
 `wp_strip_all_tags()` in that case.

 > there's no need for us to rush this so close to RC

 Yes, seems this needs a bit more to get it right.

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


More information about the wp-trac mailing list