Upgrade/Install: Avoid creating nonce during installation.

This avoids a "Table `wp_options` doesn't exist" database error when trying to create a nonce for password reset button.

When installing and using database-saved salts, `wp_create_nonce()` causes database errors as `wp_salt()` attempts to insert into the not-yet-created options table. Since authentication is not available during installation, we can safely skip creating a nonce.

Follow-up to [39684], [50129].

Props schlessera, swissspidy, sanketchodavadiya, hellofromTonya, SergeyBiryukov.
Fixes #53830.
Built from https://develop.svn.wordpress.org/trunk@51525


git-svn-id: http://core.svn.wordpress.org/trunk@51136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-08-02 16:39:00 +00:00
parent 9e33977bc9
commit 47fc56d650
2 changed files with 2 additions and 2 deletions

View File

@ -1097,7 +1097,7 @@ function wp_default_scripts( $scripts ) {
'userProfileL10n',
array(
'user_id' => $user_id,
'nonce' => wp_create_nonce( 'reset-password-for-' . $user_id ),
'nonce' => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'reset-password-for-' . $user_id ),
)
);

View File

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