diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/setup-config.php --- a/wp/wp-admin/setup-config.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/setup-config.php Tue Dec 15 13:49:49 2020 +0100 @@ -27,16 +27,16 @@ error_reporting( 0 ); if ( ! defined( 'ABSPATH' ) ) { - define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); + define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } -require( ABSPATH . 'wp-settings.php' ); +require ABSPATH . 'wp-settings.php'; /** Load WordPress Administration Upgrade API */ -require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); +require_once ABSPATH . 'wp-admin/includes/upgrade.php'; /** Load WordPress Translation Installation API */ -require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); +require_once ABSPATH . 'wp-admin/includes/translation-install.php'; nocache_headers(); @@ -55,7 +55,7 @@ ); } -// Check if wp-config.php has been created +// Check if wp-config.php has been created. if ( file_exists( ABSPATH . 'wp-config.php' ) ) { wp_die( '
' . sprintf(
@@ -63,11 +63,12 @@
__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php
',
'install.php'
- ) . '
' . sprintf(
@@ -75,7 +76,8 @@
__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php
',
'install.php'
- ) . '
wp-config.php'
);
?>
wp-config-sample.php',
'wp-config.php
'
@@ -183,10 +188,10 @@
?>
We got it.' ),
- __( 'https://codex.wordpress.org/Editing_wp-config.php' )
+ __( 'https://wordpress.org/support/article/editing-wp-config-php/' )
);
?>
' . __( 'Try again' ) . ''; + $tryagain_link = '
' . __( 'Try Again' ) . ''; if ( empty( $prefix ) ) { - wp_die( __( 'ERROR: "Table Prefix" must not be empty.' ) . $tryagain_link ); + wp_die( __( 'Error: "Table Prefix" must not be empty.' ) . $tryagain_link ); } // Validate $prefix: it can only contain letters, numbers and underscores. if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { - wp_die( __( 'ERROR: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); + wp_die( __( 'Error: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); } - // Test the db connection. + // Test the DB connection. /**#@+ * * @ignore @@ -313,7 +318,7 @@ $wpdb->show_errors( $errors ); if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. - wp_die( __( 'ERROR: "Table Prefix" is invalid.' ) ); + wp_die( __( 'Error: "Table Prefix" is invalid.' ) ); } // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). @@ -349,7 +354,7 @@ $key = 0; foreach ( $config_file as $line_num => $line ) { - if ( '$table_prefix =' == substr( $line, 0, 15 ) ) { + if ( '$table_prefix =' === substr( $line, 0, 15 ) ) { $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; continue; } @@ -393,7 +398,7 @@
wp-config.php' );
+ printf( __( 'Unable to write to %s file.' ), 'wp-config.php
' );
?>
@@ -409,7 +414,7 @@ ?>
- +