diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index ec4d1a8bbbdbc..6f7e9a9d5b834 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -40,21 +40,6 @@ nocache_headers(); -// Support wp-config-sample.php one level up, for the develop repo. -if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { - $config_file = file( ABSPATH . 'wp-config-sample.php' ); -} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) { - $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); -} else { - wp_die( - sprintf( - /* translators: %s: wp-config-sample.php */ - __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ), - 'wp-config-sample.php' - ) - ); -} - // Check if wp-config.php has been created. if ( file_exists( ABSPATH . 'wp-config.php' ) ) { wp_die( @@ -81,6 +66,21 @@ ); } +// Support wp-config-sample.php one level up, for the develop repo. +if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { + $config_file = file( ABSPATH . 'wp-config-sample.php' ); +} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) { + $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); +} else { + wp_die( + sprintf( + /* translators: %s: wp-config-sample.php */ + __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ), + 'wp-config-sample.php' + ) + ); +} + $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; /**