From f44d456a4b1ef9c305d4110597248fd3b7556a82 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 21 Mar 2020 15:42:57 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@47478 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/setup-config.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index 4ae670dd2f..f88e629f01 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -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 installing now.' ), 'wp-config.php', 'install.php' - ) . '

' + ) . '

', + 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 installing now.' ), 'wp-config.php', 'install.php' - ) . '

' + ) . '

', + 409 ); }