From 4d8ac8b13cb2b233ce723789a920ec26c750458d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 16 Aug 2024 14:27:03 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@58905 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/load-scripts.php | 15 +++++++++++---- src/wp-admin/load-styles.php | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/load-scripts.php b/src/wp-admin/load-scripts.php index c7c952f6514eb..b802394ece309 100644 --- a/src/wp-admin/load-scripts.php +++ b/src/wp-admin/load-scripts.php @@ -1,11 +1,18 @@