Upgrade/Install: Keep search engine checkbox value when reloading the Install screen.

This changeset ensures the value of the search engine checkbox is not reset to its default value when a faulty form is sent in the Install screen.

Props ramon-fincken, audrasjb, whaze, rafiahmedd, khokansardar, costdev, ankit-k-gupta.
Fixes #55900.

Built from https://develop.svn.wordpress.org/trunk@54326


git-svn-id: http://core.svn.wordpress.org/trunk@53885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb
2022-09-27 10:37:13 +00:00
parent 2c8c3fed63
commit b0ebbf6beb
2 changed files with 2 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ function display_setup_form( $error = null ) {
// Ensure that sites appear in search engines by default.
$blog_public = 1;
if ( isset( $_POST['weblog_title'] ) ) {
$blog_public = isset( $_POST['blog_public'] );
$blog_public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : $blog_public;
}
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';