[wp-trac] [WordPress Trac] #54160: sanitize_key() / _wp_customize_include() is not able to handle non-scalar values

WordPress Trac noreply at wordpress.org
Sat Dec 11 15:43:05 UTC 2021


#54160: sanitize_key() / _wp_customize_include() is not able to handle non-scalar
values
---------------------------------------------+-----------------------------
 Reporter:  dd32                             |       Owner:  hellofromTonya
     Type:  defect (bug)                     |      Status:  reopened
 Priority:  normal                           |   Milestone:  5.9
Component:  Formatting                       |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-----------------------------

Comment (by wppunk):

 Replying to [comment:27 hellofromTonya]:
 > Marking [https://github.com/WordPress/wordpress-develop/pull/2042 PR
 2042] for commit.
 >
 > Props to @wppunk for pointing out the impact of silently setting the key
 to an empty string for non-string scalar types. This PR switches to use
 `is_scalar()` instead of `is_string()`. Though `sanitize_type()` is for
 only string keys, `strtolower()` handles non-string scalar types without
 throwing an error or deprecation notice.

 Thanks so much.

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


More information about the wp-trac mailing list