[wp-trac] [WordPress Trac] #52226: PHP 8 issue: Fatal error when error_reporting is disabled

WordPress Trac noreply at wordpress.org
Sat Feb 27 11:07:43 UTC 2021


#52226: PHP 8 issue: Fatal error when error_reporting is disabled
--------------------------+-----------------------------
 Reporter:  fijisunshine  |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  5.8
Component:  Security      |     Version:  5.6
 Severity:  normal        |  Resolution:  fixed
 Keywords:  php8          |     Focuses:
--------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"50447" 50447]:
 {{{
 #!CommitTicketReference repository="" revision="50447"
 Bootstrap/Load: Check if the `error_reporting()` function exists in `wp-
 load.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.

 Props peterwilsoncc, fijisunshine, ayeshrajans.
 Fixes #52226.
 }}}

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


More information about the wp-trac mailing list