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

WordPress Trac noreply at wordpress.org
Sat Jul 30 18:19:56 UTC 2022


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

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 This is still a problem, and it crashes WordPress with a fatal error.

 https://wordpress.stackexchange.com/questions/408101/broken-kses-php-
 function-wp-kses-named-entities-crashes-wordpress/408137#408137

 As you can see from the stack trace -- and I checked all plugins and
 themes with grep -- no plugin or theme is setting $allowedentitynames

 How is it getting set to null? No idea.

 Anyway, the solution is pretty simple:

 wp-includes/kses.php line 1866

 {{{
 if ( empty( $matches[1] ) OR empty( $allowedentitynames ) ) {
 }}}

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


More information about the wp-trac mailing list