Make WordPress Core


Ignore:
Timestamp:
11/17/2020 05:22:32 PM (4 years ago)
Author:
SergeyBiryukov
Message:

App Passwords: Regenerate the .htaccess file to add a new rule.

Application Passwords introduced a new Rewrite Rule to handle the Authorization header on certain systems.

This bumps the database version and updates the file so the change is applied to sites upon upgrading to 5.6.

Follow-up to [49534].

Props pbiron, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51723.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r49581 r49632  
    875875    }
    876876
    877     if ( $wp_current_db_version < 49572 ) {
     877    if ( $wp_current_db_version < 49632 ) {
    878878        upgrade_560();
    879879    }
     
    22482248 */
    22492249function upgrade_560() {
    2250     global $wpdb;
    2251 
    2252     // Clean up the `post_category` column removed from schema in version 2.8.0.
    2253     // Its presence may conflict with WP_Post::__get().
    2254     $post_category_exists = $wpdb->get_var( "SHOW COLUMNS FROM $wpdb->posts LIKE 'post_category'" );
    2255     if ( ! is_null( $post_category_exists ) ) {
    2256         $wpdb->query( "ALTER TABLE $wpdb->posts DROP COLUMN `post_category`" );
    2257     }
    2258 
    2259     // When upgrading from WP < 5.6.0 set the core major auto-updates option to `unset` by default.
    2260     // This overrides the same option from populate_options() that is intended for new installs.
    2261     // See https://core.trac.wordpress.org/ticket/51742.
    2262     update_option( 'auto_update_core_major', 'unset' );
     2250    global $wp_current_db_version, $wpdb;
     2251
     2252    if ( $wp_current_db_version < 49572 ) {
     2253        /*
     2254         * Clean up the `post_category` column removed from schema in version 2.8.0.
     2255         * Its presence may conflict with `WP_Post::__get()`.
     2256         */
     2257        $post_category_exists = $wpdb->get_var( "SHOW COLUMNS FROM $wpdb->posts LIKE 'post_category'" );
     2258        if ( ! is_null( $post_category_exists ) ) {
     2259            $wpdb->query( "ALTER TABLE $wpdb->posts DROP COLUMN `post_category`" );
     2260        }
     2261
     2262        /*
     2263         * When upgrading from WP < 5.6.0 set the core major auto-updates option to `unset` by default.
     2264         * This overrides the same option from populate_options() that is intended for new installs.
     2265         * See https://core.trac.wordpress.org/ticket/51742.
     2266         */
     2267        update_option( 'auto_update_core_major', 'unset' );
     2268    }
     2269
     2270    if ( $wp_current_db_version < 49632 ) {
     2271        /*
     2272         * Regenerate the .htaccess file to add the `HTTP_AUTHORIZATION` rewrite rule.
     2273         * See https://core.trac.wordpress.org/ticket/51723.
     2274         */
     2275        save_mod_rewrite_rules();
     2276    }
    22632277}
    22642278
Note: See TracChangeset for help on using the changeset viewer.