[wp-trac] [WordPress Trac] #48693: Silence ini_set caused error or check if function_exists first

WordPress Trac noreply at wordpress.org
Fri Sep 13 19:51:25 UTC 2024


#48693: Silence ini_set caused error or check if function_exists first
-------------------------------------+-----------------------------
 Reporter:  drazon                   |       Owner:  SergeyBiryukov
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  Future Release
Component:  Bootstrap/Load           |     Version:  5.3
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:
-------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:18 maltfield]:
 > I'm raising the priority of this ticket because, since PHP 8, this now
 triggers a fatal error that breaks wordpress completely.

 This appears to be similar to disabling `error_reporting()` via `php.ini`,
 which was addressed in [50447] / #52226 and [58905] / #61873, but only for
 the instances called prior to `wp-config.php` loading.

 On systems where `ini_set()` is disabled, it's best to add a dummy
 function to the `wp-config.php` file to avoid fatal errors in core or
 plugins, since it does not seem feasible to edit any plugin calling
 `ini_set()`.

 If there are any calls to `ini_set()` in core before `wp-config.php` is
 loaded, those may be wrapped in a `function_exists()` check.

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


More information about the wp-trac mailing list