General: Validate host on "Are you sure?" screen.

Props voldemortensen, xknown, peterwiloncc.

Merges [54522] to the 6.0 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/6.0@54532 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2022-10-17 12:09:54 +00:00
parent 9668242b09
commit 419de4780c

View File

@ -3580,10 +3580,12 @@ function wp_nonce_ays( $action ) {
} else {
$html = __( 'The link you followed has expired.' );
if ( wp_get_referer() ) {
$wp_http_referer = remove_query_arg( 'updated', wp_get_referer() );
$wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) );
$html .= '</p><p>';
$html .= sprintf(
'<a href="%s">%s</a>',
esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
esc_url( $wp_http_referer ),
__( 'Please try again.' )
);
}