[wp-trac] [WordPress Trac] #54406: Fatal Error - Admin Filters File Does Not Exit if ABSPATH Not Defined and tries calling WordPress functions

WordPress Trac noreply at wordpress.org
Tue Nov 9 18:34:08 UTC 2021


#54406: Fatal Error - Admin Filters File Does Not Exit if ABSPATH Not Defined and
tries calling WordPress functions
----------------------------------------------+----------------------------
 Reporter:  machineitsvcs                     |      Owner:  (none)
     Type:  enhancement                       |     Status:  new
 Priority:  normal                            |  Milestone:  Awaiting
                                              |  Review
Component:  General                           |    Version:  trunk
 Severity:  minor                             |   Keywords:  needs-patch
  Focuses:  administration, coding-standards  |
----------------------------------------------+----------------------------
 For whatever reason, direct requests are being made to the "/wp-
 admin/includes/admin-filters.php" file, which does not start with a exit()
 if ABSPATH is not defined, causing a fatal error on the first function
 called, add_action(). I would like to suggest adding the typical
 "if(!defined('ABSPATH')) exit;" to prevent these fatal errors. Although I
 understand this doesn't actually affect the functionality of WordPress,
 I'm still classifying as an "enhancement" as it will improve the
 accuracy/clarity of the error log which was getting populated with these
 fatal errors.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54406>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list