From 087d11282a99245c8bb307b8c2a285757fd6c7d2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 17:18:06 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@48672 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-activate.php | 16 +++++++++++----- src/wp-includes/general-template.php | 9 +++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/wp-activate.php b/src/wp-activate.php index 3258c07d32..65a07d00b9 100644 --- a/src/wp-activate.php +++ b/src/wp-activate.php @@ -117,6 +117,8 @@ add_action( 'wp_head', 'wpmu_activate_stylesheet' ); add_action( 'wp_head', 'wp_sensitive_page_meta' ); get_header( 'wp-activate' ); + +$blog_details = get_blog_details(); ?>
@@ -124,7 +126,7 @@ get_header( 'wp-activate' );

-
+


@@ -146,7 +148,7 @@ get_header( 'wp-activate' ); printf( /* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */ __( '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' ), + network_site_url( $blog_details->path . 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() @@ -155,7 +157,7 @@ get_header( 'wp-activate' ); printf( /* translators: 1: Site URL, 2: Username, 3: User email address, 4: Lost password URL. */ __( 'Your site at %1$s is active. You may now log in to your 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.' ), - sprintf( '%1$s', $signup->domain ), + sprintf( '%1$s%2$s', $signup->domain, $blog_details->path ), $signup->user_login, $signup->user_email, wp_lostpassword_url() @@ -195,8 +197,12 @@ get_header( 'wp-activate' );

Log in or go back to the homepage.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() ); + printf( + /* translators: 1: Login URL, 2: Network home URL. */ + __( 'Your account is now activated. Log in or go back to the homepage.' ), + network_site_url( $blog_details->path . 'wp-login.php', 'login' ), + network_home_url( $blog_details->path ) + ); ?>

'lostpassword', + ); + if ( ! empty( $redirect ) ) { $args['redirect_to'] = urlencode( $redirect ); } - $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) ); + $blog_details = get_blog_details(); + + $lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php', 'login' ) ); /** * Filters the Lost Password URL.