Make WordPress Core

Changeset 51525


Ignore:
Timestamp:
08/02/2021 04:37:57 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r51471 r51525  
    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    );
Note: See TracChangeset for help on using the changeset viewer.