Make WordPress Core

Ticket #39311: fix-wp-activate.39311.4.diff

File fix-wp-activate.39311.4.diff, 3.6 KB (added by pkarjala, 3 years ago)

Updates to wp-activate.php and general-template.php to display correct path for subsites with path.

  • wp-activate.php

    diff --git a/wp-activate.php b/wp-activate.php
    index 3258c07d32..c39c379197 100644
    a b add_action( 'wp_head', 'wpmu_activate_stylesheet' ); 
    117117add_action( 'wp_head', 'wp_sensitive_page_meta' );
    118118
    119119get_header( 'wp-activate' );
     120
     121$blog_details = get_blog_details();
    120122?>
    121123
    122124<div id="signup-content" class="widecolumn">
    get_header( 'wp-activate' ); 
    124126        <?php if ( ! $key ) { ?>
    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>
    130132                                <br /><input type="text" name="key" id="key" value="" size="50" />
    get_header( 'wp-activate' ); 
    146148                                printf(
    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,
    152154                                        wp_lostpassword_url()
    get_header( 'wp-activate' ); 
    155157                                printf(
    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">%1$s</a>', $signup->domain . $blog_details->path ),
    159161                                        $signup->user_login,
    160162                                        $signup->user_email,
    161163                                        wp_lostpassword_url()
    get_header( 'wp-activate' ); 
    196198                                <p class="view">
    197199                                <?php
    198200                                        /* 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() );
     201                                        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( $blog_details->path . 'wp-login.php', 'login' ), network_home_url( $blog_details->path ) );
    200202                                ?>
    201203                                </p>
    202204                                <?php
  • wp-includes/general-template.php

    diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
    index 437dd4dc1c..2c65ab2b89 100644
    a b function wp_lostpassword_url( $redirect = '' ) { 
    563563                $args['redirect_to'] = urlencode( $redirect );
    564564        }
    565565
    566         $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
     566        $blog_details = get_blog_details();
     567
     568        $lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php?action=lostpassword', 'login' ) );
    567569
    568570        /**
    569571         * Filters the Lost Password URL.