Coding Standards: Correct `db_version` check in `wp-admin/admin.php`.

Follow-up to [47785].

See #49239.
Built from https://develop.svn.wordpress.org/trunk@47787


git-svn-id: http://core.svn.wordpress.org/trunk@47563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-05-12 20:59:08 +00:00
parent bfba3fc458
commit 1e813b0275
2 changed files with 5 additions and 2 deletions

View File

@ -36,6 +36,7 @@ require_once dirname( __DIR__ ) . '/wp-load.php';
nocache_headers(); nocache_headers();
if ( get_option( 'db_upgraded' ) ) { if ( get_option( 'db_upgraded' ) ) {
flush_rewrite_rules(); flush_rewrite_rules();
update_option( 'db_upgraded', false ); update_option( 'db_upgraded', false );
@ -45,7 +46,9 @@ if ( get_option( 'db_upgraded' ) ) {
* @since 2.8.0 * @since 2.8.0
*/ */
do_action( 'after_db_upgrade' ); do_action( 'after_db_upgrade' );
} elseif ( get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) {
} elseif ( (int) get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) {
if ( ! is_multisite() ) { if ( ! is_multisite() ) {
wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
exit; exit;

View File

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