Skip to content

Commit 3a189c9

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51525 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2ba4a48 commit 3a189c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/script-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ function wp_default_scripts( $scripts ) {
10971097
'userProfileL10n',
10981098
array(
10991099
'user_id' => $user_id,
1100-
'nonce' => wp_create_nonce( 'reset-password-for-' . $user_id ),
1100+
'nonce' => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'reset-password-for-' . $user_id ),
11011101
)
11021102
);
11031103

0 commit comments

Comments
 (0)