diff --git a/wp-admin/authorize-application.php b/wp-admin/authorize-application.php index a6aac398fd..fa8d919747 100644 --- a/wp-admin/authorize-application.php +++ b/wp-admin/authorize-application.php @@ -88,6 +88,18 @@ if ( is_wp_error( $is_valid ) ) { ); } +if ( ! empty( $_SERVER['PHP_AUTH_USER'] ) || ! empty( $_SERVER['PHP_AUTH_PW'] ) ) { + wp_die( + __( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ), + __( 'Cannot Authorize Application' ), + array( + 'response' => 501, + 'link_text' => __( 'Go Back' ), + 'link_url' => $reject_url ? add_query_arg( 'error', 'disabled', $reject_url ) : admin_url(), + ) + ); +} + if ( ! wp_is_application_passwords_available_for_user( $user ) ) { if ( wp_is_application_passwords_available() ) { $message = __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ); diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index aaab1862da..bd73cd6204 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -874,7 +874,7 @@ function upgrade_all() { upgrade_550(); } - if ( $wp_current_db_version < 49735 ) { + if ( $wp_current_db_version < 49752 ) { upgrade_560(); } @@ -2278,6 +2278,19 @@ function upgrade_560() { if ( $wp_current_db_version < 49735 ) { delete_transient( 'dirsize_cache' ); } + + if ( $wp_current_db_version < 49752 ) { + $results = $wpdb->get_results( + $wpdb->prepare( + "SELECT 1 FROM {$wpdb->usermeta} WHERE meta_key = %s LIMIT 1", + WP_Application_Passwords::USERMETA_KEY_APPLICATION_PASSWORDS + ) + ); + + if ( ! empty( $results ) ) { + update_site_option( WP_Application_Passwords::OPTION_KEY_IN_USE, 1 ); + } + } } /** diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 110eee5d7f..4177288547 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -738,27 +738,34 @@ endif; -