[wp-trac] [WordPress Trac] #56434: Check that the input is a string in wp_strip_all_tags()

WordPress Trac noreply at wordpress.org
Thu Aug 25 12:50:40 UTC 2022


#56434: Check that the input is a string in wp_strip_all_tags()
--------------------------------------------+---------------------
 Reporter:  chocofc1                        |       Owner:  (none)
     Type:  defect (bug)                    |      Status:  new
 Priority:  normal                          |   Milestone:  6.1
Component:  Formatting                      |     Version:  2.9
 Severity:  minor                           |  Resolution:
 Keywords:  has-patch has-unit-tests php81  |     Focuses:
--------------------------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:5 jrf]:
 > If you want my opinion, I would combine the two approaches:
 >
 > Basically use the patch from [https://github.com/WordPress/wordpress-
 develop/pull/3133 GH #3133], but add the `_doing_it_wrong()` from
 [https://github.com/WordPress/wordpress-develop/pull/3132 GH #3132] within
 the `if ( ! is_string( $string ) ) {` condition before returning.
 > I would not special case `null`, but treat it the same as other non-
 scalar values.

 Thanks! That makes sense to me.

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


More information about the wp-trac mailing list