diff -r 34716fd837a4 -r be944660c56a wp/wp-load.php --- a/wp/wp-load.php Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-load.php Wed Sep 21 18:19:35 2022 +0200 @@ -21,7 +21,20 @@ define( 'ABSPATH', __DIR__ . '/' ); } -error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); +/* + * The error_reporting() function can be disabled in php.ini. On systems where that is the case, + * it's best to add a dummy function to the wp-config.php file, but as this call to the function + * is run prior to wp-config.php loading, it is wrapped in a function_exists() check. + */ +if ( function_exists( 'error_reporting' ) ) { + /* + * Initialize error reporting to a known set of levels. + * + * This will be adapted in wp_debug_mode() located in wp-includes/load.php based on WP_DEBUG. + * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels. + */ + error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); +} /* * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php @@ -71,8 +84,8 @@ wp_check_php_mysql_versions(); wp_load_translations_early(); - // Die with an error message - $die = sprintf( + // Die with an error message. + $die = '
' . sprintf(
/* translators: %s: wp-config.php */
__( "There doesn't seem to be a %s file. I need this before we can get started." ),
'wp-config.php
'
@@ -87,7 +100,7 @@
__( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ),
'wp-config.php
'
) . '
' . __( 'Create a Configuration File' ) . ''; + $die .= '
'; wp_die( $die, __( 'WordPress › Error' ) ); }