WordPress.org

Make WordPress Core

Changeset 19027


Ignore:
Timestamp:
10/20/2011 02:40:11 PM (8 years ago)
Author:
nacin
Message:

Use wp_lostpassword_url() instead of site_url(wp-login...). Update wp_lostpassword_url() to use network_site_url(). props markoheijnen, fixes #18808.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-activate.php

    r17831 r19027  
    6464                echo '<p class="lead-in">';
    6565                if ( $signup->domain . $signup->path == '' ) {
    66                     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' ) );
     66                    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() );
    6767                } else {
    68                     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' ) );
     68                    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() );
    6969                }
    7070                echo '</p>';
  • trunk/wp-includes/general-template.php

    r18963 r19027  
    289289 * @param string $redirect Path to redirect to on login.
    290290 */
    291 function wp_lostpassword_url($redirect = '') {
     291function wp_lostpassword_url( $redirect = '' ) {
    292292    $args = array( 'action' => 'lostpassword' );
    293293    if ( !empty($redirect) ) {
     
    295295    }
    296296
    297     $lostpassword_url = add_query_arg($args, site_url('wp-login.php', 'login'));
    298     return apply_filters('lostpassword_url', $lostpassword_url, $redirect);
     297    $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
     298    return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
    299299}
    300300
  • trunk/wp-includes/user.php

    r19016 r19027  
    8989
    9090    if ( !$userdata )
    91         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')));
     91        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()));
    9292
    9393    if ( is_multisite() ) {
     
    110110    if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) )
    111111        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>?' ),
    112         $username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) );
     112        $username, wp_lostpassword_url() ) );
    113113
    114114    $user =  new WP_User($userdata->ID);
  • trunk/wp-login.php

    r18763 r19027  
    531531<p id="nav">
    532532<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
    533 <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>
     533<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
    534534</p>
    535535
     
    660660<?php elseif ( get_option('users_can_register') ) : ?>
    661661<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
    662 <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>
     662<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
    663663<?php else : ?>
    664 <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>
     664<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
    665665<?php endif; ?>
    666666</p>
Note: See TracChangeset for help on using the changeset viewer.