[wp-trac] [WordPress Trac] #40606: wp_filter_nohtml_kses escaping single quotes even when no HTML tags are being used in the string

WordPress Trac noreply at wordpress.org
Tue Jul 28 05:44:43 UTC 2020


#40606: wp_filter_nohtml_kses escaping single quotes even when no HTML tags are
being used in the string
----------------------------+----------------------
 Reporter:  samuelaguilera  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  General         |     Version:  4.7.4
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |     Focuses:
----------------------------+----------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hey @samuelaguilera, I apologise for this ticket not receiving any
 feedback in quite some time.

 The `wp_filter_nohtml_kses` function is designed to act on a filter which
 accepts, and returns, slashed data.

 The correct way to call the function in this case would therefor be
 `wp_filter_nohtml_kses(  "You\'re not allowed to do this!" );` and get the
 same result back.

 For reference for others, the correct function to call in this case would
 be `wp_kses( "You're not allowed to do this!", "strip" );`.

 I'm marking this as invalid based on the above, if anyone wants to suggest
 some documentation changes for this, upload a patch and re-open the ticket
 please :)

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


More information about the wp-trac mailing list