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.
Merges [51525] to the 5.8 branch.
Fixes #53830.


Built from https://develop.svn.wordpress.org/branches/5.8@51546


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2021-08-05 00:33:00 +00:00
parent 720a2a7035
commit e9dd9dddb1
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.8.1-alpha-51516';
$wp_version = '5.8.1-alpha-51546';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.