mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
App Passwords: Fix success=false not being appended to fallback reject url.
Props TimothyBlynJacobs, georgestephanis. Fixes #51581. Built from https://develop.svn.wordpress.org/trunk@49272 git-svn-id: http://core.svn.wordpress.org/trunk@49034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9dc6d6147a
commit
fe8bb3ea58
@ -22,7 +22,7 @@ if ( isset( $_POST['action'] ) && 'authorize_application_password' === $_POST['a
|
||||
|
||||
if ( isset( $_POST['reject'] ) ) {
|
||||
if ( $reject_url ) {
|
||||
$redirect = add_query_arg( 'success', 'false', $reject_url );
|
||||
$redirect = $reject_url;
|
||||
} else {
|
||||
$redirect = admin_url();
|
||||
}
|
||||
@ -57,8 +57,16 @@ $title = __( 'Authorize Application' );
|
||||
|
||||
$app_name = ! empty( $_REQUEST['app_name'] ) ? $_REQUEST['app_name'] : '';
|
||||
$success_url = ! empty( $_REQUEST['success_url'] ) ? $_REQUEST['success_url'] : null;
|
||||
$reject_url = ! empty( $_REQUEST['reject_url'] ) ? $_REQUEST['reject_url'] : $success_url;
|
||||
$user = wp_get_current_user();
|
||||
|
||||
if ( ! empty( $_REQUEST['reject_url'] ) ) {
|
||||
$reject_url = $_REQUEST['reject_url'];
|
||||
} elseif ( $success_url ) {
|
||||
$reject_url = add_query_arg( 'success', 'false', $success_url );
|
||||
} else {
|
||||
$reject_url = null;
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
|
||||
$request = compact( 'app_name', 'success_url', 'reject_url' );
|
||||
$is_valid = wp_is_authorize_application_password_request_valid( $request, $user );
|
||||
@ -230,14 +238,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
printf(
|
||||
/* translators: %s: The URL the user is being redirected to. */
|
||||
__( 'You will be sent to %s' ),
|
||||
'<strong><kbd>' . esc_html(
|
||||
add_query_arg(
|
||||
array(
|
||||
'success' => 'false',
|
||||
),
|
||||
$reject_url
|
||||
)
|
||||
) . '</kbd></strong>'
|
||||
'<strong><kbd>' . esc_html( $reject_url ) . '</kbd></strong>'
|
||||
);
|
||||
} else {
|
||||
_e( 'You will be returned to the WordPress Dashboard, and no changes will be made.' );
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.6-beta1-49271';
|
||||
$wp_version = '5.6-beta1-49272';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user