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

WordPress Trac noreply at wordpress.org
Sun Jul 31 18:34:29 UTC 2022


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

 * keywords:   => has-patch needs-testing
 * status:  closed => reopened
 * resolution:  wontfix =>
 * milestone:   => 6.1


Comment:

 Replying to [comment:9 TJNowell]:
 > Perhaps the `else` case would be a good place for it though, as well as
 checks if those variables exist and have values. It would still result in
 the same situation but the user would have an idea of how to fix it rather
 than being stuck not knowing what to do.

 Thanks! [attachment:"47357.diff"] goes in that direction.

 This still leads to a fatal error if any of the globals are not set, but
 displays a more helpful message.

 To test the patch:
 1. Add `define( 'CUSTOM_TAGS', false );` to `wp-config.php`.
 2. Set `WP_DEBUG` to true.
 3. Make sure any of these globals is not set:
  * `$allowedposttags`
  * `$allowedtags`
  * `$allowedentitynames`
  * `$allowedxmlentitynames`
 4. Check if an appropriate message from the patch is displayed or logged.

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


More information about the wp-trac mailing list