WordPress.org

Make WordPress Core

Ticket #13087: 13087.1.patch

File 13087.1.patch, 6.4 KB (added by ocean90, 4 years ago)

the real patch

  • wp-signup.php

     
    99require_once( ABSPATH . WPINC . '/registration.php' ); 
    1010 
    1111if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { 
    12         wp_redirect( "http://{$current_site->domain}{$current_site->path}" ); 
     12        wp_redirect( network_home_url() ); 
    1313        die(); 
    1414} 
    1515 
     
    2828} 
    2929 
    3030if ( !is_main_site() ) { 
    31         wp_redirect( "http://" . $current_site->domain . $current_site->path . "wp-signup.php" ); 
     31        wp_redirect( network_home_url( 'wp-signup.php' ) ); 
    3232        die(); 
    3333} 
    3434 
     35// Fix for page title 
     36$wp_query->is_404 = false; 
     37 
    3538function wpmu_signup_stylesheet() { 
    3639        ?> 
    3740        <style type="text/css"> 
     
    7578        if ( !is_subdomain_install() ) 
    7679                echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />'; 
    7780        else 
    78                 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />'; 
     81                echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . '</span><br />'; 
    7982 
    8083        if ( !is_user_logged_in() ) { 
    8184                print '(<strong>' . __( 'Your address will be ' ); 
     
    98101        <div id="privacy"> 
    99102        <p class="privacy-intro"> 
    100103            <label for="blog_public_on"><?php _e('Privacy:') ?></label> 
    101             <?php _e('I would like my site to appear in search engines like Google and Technorati, and in public listings around this network.'); ?> 
     104            <?php _e('Allow my blog to appear in search engines like Google, Technorati, and in public listings around this network.'); ?> 
    102105            <div style="clear:both;"></div> 
    103106            <label class="checkbox" for="blog_public_on"> 
    104107                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> /> 
     
    137140        <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?> 
    138141                <p class="error"><?php echo $errmsg ?></p> 
    139142        <?php } ?> 
    140         <input name="user_email" type="text" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('(We&#8217;ll send your password to this address, so <strong>triple-check it</strong>.)') ?> 
     143        <input name="user_email" type="text" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('(Double-check your email address before continuing.)') ?> 
    141144        <?php 
    142145        if ( $errmsg = $errors->get_error_message('generic') ) { 
    143146                echo '<p class="error">' . $errmsg . '</p>'; 
     
    177180                        <?php _e( 'Sites you are already a member of:' ) ?> 
    178181                        <ul> 
    179182                                <?php foreach ( $blogs as $blog ) { 
    180                                         echo "<li><a href='http://" . $blog->domain . $blog->path . "'>" . $blog->domain . $blog->path . "</a></li>"; 
     183                                        echo "<li><a href='" . esc_url( get_home_url( $blog->userblog_id ) ). "'>" . get_home_url( $blog->userblog_id ) . "</a></li>"; 
    181184                                } ?> 
    182185                        </ul> 
    183186                </p> 
     
    360363        <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> 
    361364 
    362365        <p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ) ?></p> 
    363         <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given. It should arrive within 30 minutes.' ),  $user_email) ?></p> 
     366        <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ),  $user_email) ?></p> 
    364367        <p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p> 
    365368        <h2><?php _e( 'Still waiting for your email?' ); ?></h2> 
    366369        <p> 
    367370                <?php _e( 'If you haven&#8217;t received your email yet, there are a number of things you can do:' ) ?> 
    368371                <ul id="noemail-tips"> 
    369                         <li><p><strong><?php _e( 'Wait a little longer.  Sometimes delivery of email can be delayed by processes outside of our control.' ) ?></strong></p></li> 
    370                         <li><p><?php _e( 'Check the junk or spam folder of your email client.  Sometime emails wind up there by mistake.' ) ?></p></li> 
    371                         <li><?php printf( __( 'Have you entered your email correctly?  We think it&#8217;s %s but if you have entered it incorrectly, you will not receive it.' ), $user_email ) ?></li> 
     372                        <li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ) ?></strong></p></li> 
     373                        <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) ?></p></li> 
     374                        <li><?php printf( __( 'Have you entered your email correctly?  You have entered %s, if it&#8217;s incorrectly, you will not receive your email.' ), $user_email ) ?></li> 
    372375                </ul> 
    373376        </p> 
    374377        <?php 
     
    383386$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 
    384387 
    385388if ( is_super_admin() ) 
    386         echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; registrations. To change or disable registration go to your <a href="wp-admin/ms-options.php">Options page</a>.' ), $active_signup ) . '</div>'; 
     389        echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), $active_signup, esc_url( network_admin_url( 'ms-options.php' ) ) ) . '</div>'; 
    387390 
    388391$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; 
    389392 
     
    424427                        elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) 
    425428                                signup_user( $newblogname, $user_email ); 
    426429                        elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) 
    427                                 _e( 'We are sorry. We are not accepting new registrations at this time.' ); 
     430                                _e( 'Sorry, new registrations are not allowed at this time.' ); 
    428431                        else 
    429432                                _e( 'You are logged in already. No need to register again!' ); 
    430433