Login and Registration: Correctly encode the redirect location URL when it's passed as a query parameter to the lost password URL.

Props adhun

Fixes #40728


git-svn-id: https://develop.svn.wordpress.org/trunk@41121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-07-23 01:05:08 +00:00
parent 384ac2a367
commit 5f9b52df35

View File

@ -492,7 +492,7 @@ function wp_login_form( $args = array() ) {
function wp_lostpassword_url( $redirect = '' ) {
$args = array( 'action' => 'lostpassword' );
if ( !empty($redirect) ) {
$args['redirect_to'] = $redirect;
$args['redirect_to'] = urlencode( $redirect );
}
$lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );