[wp-trac] [WordPress Trac] #47357: $allowedentitynames could be null

WordPress Trac noreply at wordpress.org
Tue Oct 11 15:48:17 UTC 2022


#47357: $allowedentitynames could be null
-------------------------------------+-----------------------
 Reporter:  doctorlai                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  6.2
Component:  Formatting               |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------

Comment (by ironprogrammer):

 == Test Report

 Patch tested:
 https://core.trac.wordpress.org/attachment/ticket/47357/47357.diff 👍🏻

 === Expected Results
 - ❌ Was able to reproduce the error by adding `define( 'CUSTOM_TAGS',
 true );` to `wp-config.php` with TT3 theme active. The errors logged are:
     PHP Warning:  in_array() expects parameter 2 to be array, null given
 in ../wordpress-develop/src/wp-includes/kses.php on line 1872

 === Environment
 - Hardware: MacBook Pro Apple M1 Pro
 - OS: macOS 12.6
 - Browser: Google Chrome 105.0.5195.125
 - Server: nginx/1.23.1
 - PHP: 7.4.32
 - WordPress: 6.1-beta3-54390-src
 - Theme: twentytwentythree v1.0

 ==== Actual Results
 - ✅ After patching, the newly introduced `_doing_it_wrong()` notice was
 output in logs:
     PHP Notice:  Function wp_kses_allowed_html was called
 <strong>incorrectly</strong>. When using the <code>CUSTOM_TAGS</code>
 constant, make sure to set the <code>$allowedposttags</code> global to an
 array. Please see <a href="https://wordpress.org/support/article
 /debugging-in-wordpress/">Debugging in WordPress</a> for more information.
 (This message was added in version 6.1.0.) in ../wordpress-develop/src/wp-
 includes/functions.php on line 5836

 This notice appeared for `$allowedposttags` (above), `$allowedtags`,
 `$allowedentitynames`, and `$allowedxmlentitynames`.

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


More information about the wp-trac mailing list