[wp-trac] [WordPress Trac] #61873: Check if error_reporting function exists, otherwise breaks php8 installs when disabled in the ini config

WordPress Trac noreply at wordpress.org
Fri Aug 16 14:27:19 UTC 2024


#61873: Check if error_reporting function exists, otherwise breaks php8 installs
when disabled in the ini config
----------------------------+-----------------------------
 Reporter:  gansbrest       |       Owner:  SergeyBiryukov
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  6.7
Component:  Administration  |     Version:  trunk
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  administration
----------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58905" 58905]:
 {{{
 #!CommitTicketReference repository="" revision="58905"
 Script Loader: Check if `error_reporting()` exists in
 `load-(scripts|styles).php`.

 This avoids a fatal error on PHP 8 if `error_reporting()` is disabled in
 `php.ini`.

 On systems with this function disabled, it's best to add a dummy function
 to the `wp-config.php` file, as there are multiple other calls in core or
 plugins.

 However, as this call to the function is run prior to `wp-config.php`
 loading, it is now wrapped in a `function_exists()` check.

 Follow-up to [50447].

 Props gansbrest, sabernhardt, jrf, martin.krcho, SergeyBiryukov.
 Fixes #61873.
 }}}

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


More information about the wp-trac mailing list