Upgrade/Install: Return a more appropriate HTTP response status code (`409 Conflict`) if the `wp-config.php` file already exists.

Props linyows, ocean90.
Fixes #42466.
Built from https://develop.svn.wordpress.org/trunk@47478


git-svn-id: http://core.svn.wordpress.org/trunk@47267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-03-21 15:44:15 +00:00
parent 77e32cff47
commit 248a115c2b
2 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,8 @@ if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
__( '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 <a href="%2$s">installing now</a>.' ), __( '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 <a href="%2$s">installing now</a>.' ),
'<code>wp-config.php</code>', '<code>wp-config.php</code>',
'install.php' 'install.php'
) . '</p>' ) . '</p>',
409
); );
} }
@ -75,7 +76,8 @@ if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '
__( '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 <a href="%2$s">installing now</a>.' ), __( '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 <a href="%2$s">installing now</a>.' ),
'<code>wp-config.php</code>', '<code>wp-config.php</code>',
'install.php' 'install.php'
) . '</p>' ) . '</p>',
409
); );
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-47476'; $wp_version = '5.5-alpha-47478';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.