wp/wp-load.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- 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 = '<p>' . sprintf(
 		/* translators: %s: wp-config.php */
 		__( "There doesn't seem to be a %s file. I need this before we can get started." ),
 		'<code>wp-config.php</code>'
@@ -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." ),
 		'<code>wp-config.php</code>'
 	) . '</p>';
-	$die .= '<p><a href="' . $path . '" class="button button-large">' . __( 'Create a Configuration File' ) . '</a>';
+	$die .= '<p><a href="' . $path . '" class="button button-large">' . __( 'Create a Configuration File' ) . '</a></p>';
 
 	wp_die( $die, __( 'WordPress &rsaquo; Error' ) );
 }