From 6355548ea2b6b8851263c208537b8ad792cf6647 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 20 Oct 2011 14:40:11 +0000 Subject: [PATCH] Use wp_lostpassword_url() instead of site_url(wp-login...). Update wp_lostpassword_url() to use network_site_url(). props markoheijnen, fixes #18808. git-svn-id: https://develop.svn.wordpress.org/trunk@19027 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-activate.php | 4 ++-- wp-includes/general-template.php | 6 +++--- wp-includes/user.php | 4 ++-- wp-login.php | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-activate.php b/wp-activate.php index 1ec40287dc..4f72070943 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -63,9 +63,9 @@ get_header(); '; if ( $signup->domain . $signup->path == '' ) { - printf( __('Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) ); + printf( __('Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() ); } else { - printf( __('Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) ); + printf( __('Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() ); } echo '

'; } else { diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 0d9821c225..315b2e30d7 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -288,14 +288,14 @@ function wp_login_form( $args = array() ) { * * @param string $redirect Path to redirect to on login. */ -function wp_lostpassword_url($redirect = '') { +function wp_lostpassword_url( $redirect = '' ) { $args = array( 'action' => 'lostpassword' ); if ( !empty($redirect) ) { $args['redirect_to'] = $redirect; } - $lostpassword_url = add_query_arg($args, site_url('wp-login.php', 'login')); - return apply_filters('lostpassword_url', $lostpassword_url, $redirect); + $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') ); + return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect ); } /** diff --git a/wp-includes/user.php b/wp-includes/user.php index e3ca1310fe..0ef0490198 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -88,7 +88,7 @@ function wp_authenticate_username_password($user, $username, $password) { $userdata = get_user_by('login', $username); if ( !$userdata ) - return new WP_Error('invalid_username', sprintf(__('ERROR: Invalid username. Lost your password?'), site_url('wp-login.php?action=lostpassword', 'login'))); + return new WP_Error('invalid_username', sprintf(__('ERROR: Invalid username. Lost your password?'), wp_lostpassword_url())); if ( is_multisite() ) { // Is user marked as spam? @@ -109,7 +109,7 @@ function wp_authenticate_username_password($user, $username, $password) { if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) ) return new WP_Error( 'incorrect_password', sprintf( __( 'ERROR: The password you entered for the username %1$s is incorrect. Lost your password?' ), - $username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) ); + $username, wp_lostpassword_url() ) ); $user = new WP_User($userdata->ID); return $user; diff --git a/wp-login.php b/wp-login.php index f6b0646973..8e7b79e28a 100644 --- a/wp-login.php +++ b/wp-login.php @@ -530,7 +530,7 @@ case 'register' : | - + - +