From 107f660a7e9efd2addb01b24127750f2ea7ce5a5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 20 Aug 2022 00:32:10 +0000 Subject: [PATCH] Coding Standards: Simplify the logic in `wp_not_installed()`. The function to check whether WordPress is not installed has evolved over time, ending up with duplicate conditionals. This commit combines two conditionals into a single one and includes an early return. Follow-up to [672], [676], [725], [1184], [1401], [1980], [2171], [2467], [2468], [2486], [2703], [3011], [3670], [12688], [12732], [12762], [13253], [29599], [30581], [34828]. See #55647. Built from https://develop.svn.wordpress.org/trunk@53915 git-svn-id: http://core.svn.wordpress.org/trunk@53474 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/load.php | 32 ++++++++++++++++---------------- wp-includes/version.php | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index 5a251af21e..3b0b89af8b 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -768,23 +768,23 @@ function wp_start_object_cache() { * @access private */ function wp_not_installed() { - if ( is_multisite() ) { - if ( ! is_blog_installed() && ! wp_installing() ) { - nocache_headers(); - - wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); - } - } elseif ( ! is_blog_installed() && ! wp_installing() ) { - nocache_headers(); - - require ABSPATH . WPINC . '/kses.php'; - require ABSPATH . WPINC . '/pluggable.php'; - - $link = wp_guess_url() . '/wp-admin/install.php'; - - wp_redirect( $link ); - die(); + if ( is_blog_installed() || wp_installing() ) { + return; } + + nocache_headers(); + + if ( is_multisite() ) { + wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); + } + + require ABSPATH . WPINC . '/kses.php'; + require ABSPATH . WPINC . '/pluggable.php'; + + $link = wp_guess_url() . '/wp-admin/install.php'; + + wp_redirect( $link ); + die(); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index e8650ae81e..5446caef32 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53914'; +$wp_version = '6.1-alpha-53915'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.