WordPress.org

Make WordPress Core

Changeset 48672


Ignore:
Timestamp:
07/28/2020 05:18:06 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Login and Registration: Link to the correct site after activating a user on a Multisite install in subdirectory mode.

Props pkarjala, Mista-Flo, tmoore41, Ipstenu, ksoares, mukesh27, whyisjake.
Fixes #39311.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-activate.php

    r47550 r48672  
    118118
    119119get_header( 'wp-activate' );
     120
     121$blog_details = get_blog_details();
    120122?>
    121123
     
    125127
    126128        <h2><?php _e( 'Activation Key Required' ); ?></h2>
    127         <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php' ); ?>">
     129        <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( $blog_details->path . 'wp-activate.php' ); ?>">
    128130            <p>
    129131                <label for="key"><?php _e( 'Activation Key:' ); ?></label>
     
    147149                    /* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
    148150                    __( '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>.' ),
    149                     network_site_url( 'wp-login.php', 'login' ),
     151                    network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
    150152                    $signup->user_login,
    151153                    $signup->user_email,
     
    156158                    /* translators: 1: Site URL, 2: Username, 3: User email address, 4: Lost password URL. */
    157159                    __( 'Your site at %1$s is active. You may now log in to your 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>.' ),
    158                     sprintf( '<a href="http://%1$s">%1$s</a>', $signup->domain ),
     160                    sprintf( '<a href="http://%1$s%2$s">%1$s%2$s</a>', $signup->domain, $blog_details->path ),
    159161                    $signup->user_login,
    160162                    $signup->user_email,
     
    196198                <p class="view">
    197199                <?php
    198                     /* translators: 1: Login URL, 2: Network home URL. */
    199                     printf( __( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() );
     200                    printf(
     201                        /* translators: 1: Login URL, 2: Network home URL. */
     202                        __( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ),
     203                        network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
     204                        network_home_url( $blog_details->path )
     205                    );
    200206                ?>
    201207                </p>
  • trunk/src/wp-includes/general-template.php

    r48573 r48672  
    606606 */
    607607function wp_lostpassword_url( $redirect = '' ) {
    608     $args = array();
     608    $args = array(
     609        'action' => 'lostpassword',
     610    );
     611
    609612    if ( ! empty( $redirect ) ) {
    610613        $args['redirect_to'] = urlencode( $redirect );
    611614    }
    612615
    613     $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
     616    $blog_details = get_blog_details();
     617
     618    $lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php', 'login' ) );
    614619
    615620    /**
Note: See TracChangeset for help on using the changeset viewer.