From 31702738d691565151443b6f0f09876e673a671d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 17:20: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. Built from https://develop.svn.wordpress.org/trunk@48672 git-svn-id: http://core.svn.wordpress.org/trunk@48434 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-activate.php | 16 +++++++++++----- wp-includes/general-template.php | 9 +++++++-- wp-includes/version.php | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/wp-activate.php b/wp-activate.php index 3258c07d32..65a07d00b9 100644 --- a/wp-activate.php +++ b/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. diff --git a/wp-includes/version.php b/wp-includes/version.php index e5001012b9..5294490b4a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta4-48671'; +$wp_version = '5.5-beta4-48672'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.