Skip to content

Commit

Permalink
Use wp_lostpassword_url() instead of site_url(wp-login...). Update wp…
Browse files Browse the repository at this point in the history
…_lostpassword_url() to use network_site_url(). props markoheijnen, fixes #18808.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Oct 20, 2011
1 parent f70954c commit 92ba22e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions wp-activate.php
Expand Up @@ -63,9 +63,9 @@ function wpmu_activate_stylesheet() {
<?php
echo '<p class="lead-in">';
if ( $signup->domain . $signup->path == '' ) {
printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. 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 <a href="%4$s">reset your password</a>.'), 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 <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. 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 <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() );
} else {
printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. 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 <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) );
printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. 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 <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() );
}
echo '</p>';
} else {
Expand Down
6 changes: 3 additions & 3 deletions wp-includes/general-template.php
Expand Up @@ -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 );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/user.php
Expand Up @@ -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(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()));

if ( is_multisite() ) {
// Is user marked as spam?
Expand All @@ -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( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ),
$username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) );
$username, wp_lostpassword_url() ) );

$user = new WP_User($userdata->ID);
return $user;
Expand Down
6 changes: 3 additions & 3 deletions wp-login.php
Expand Up @@ -530,7 +530,7 @@ function register_new_user( $user_login, $user_email ) {

<p id="nav">
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
</p>

<?php
Expand Down Expand Up @@ -659,9 +659,9 @@ function register_new_user( $user_login, $user_email ) {
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
<?php elseif ( get_option('users_can_register') ) : ?>
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php else : ?>
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php endif; ?>
</p>
<?php } ?>
Expand Down

0 comments on commit 92ba22e

Please sign in to comment.