Ticket #31495: 31495.patch
File 31495.patch, 7.0 KB (added by , 10 years ago) |
---|
-
wp-activate.php
14 14 require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 15 15 16 16 if ( !is_multisite() ) { 17 wp_redirect( site_url( '/wp-login.php?action=register') );17 wp_redirect( wp_registration_url() ); 18 18 die(); 19 19 } 20 20 … … 107 107 } else { 108 108 $url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int) $result['blog_id'] ) : ''; 109 109 $user = get_userdata( (int) $result['user_id'] ); 110 switch_to_blog( (int) $result['blog_id'] ); 111 $login_url = wp_login_url(); 112 restore_current_blog(); 110 113 ?> 111 114 <h2><?php _e('Your account is now active!'); ?></h2> 112 115 … … 116 119 </div> 117 120 118 121 <?php if ( $url && $url != network_home_url( '', 'http' ) ) : ?> 119 <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php'); ?></p>122 <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, esc_url( $login_url ) ); ?></p> 120 123 <?php else: ?> 121 124 <p class="view"><?php 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() ); ?></p> 122 125 <?php endif; -
wp-admin/install.php
156 156 // Let's check to make sure WP isn't already installed. 157 157 if ( is_blog_installed() ) { 158 158 display_header(); 159 die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href=" ../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' );159 die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="' . esc_url( wp_login_url() ) . '" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' ); 160 160 } 161 161 162 162 global $wp_version, $required_php_version, $required_mysql_version; … … 291 291 </tr> 292 292 </table> 293 293 294 <p class="step"><a href=" ../wp-login.php" class="button button-large"><?php _e( 'Log In' ); ?></a></p>294 <p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>" class="button button-large"><?php _e( 'Log In' ); ?></a></p> 295 295 296 296 <?php 297 297 } -
wp-admin/network.php
526 526 <?php endif; // end IIS/Apache code branches. 527 527 528 528 if ( !is_multisite() ) { ?> 529 <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.') ); ?> <a href="<?php echo esc_url( site_url( 'wp-login.php') ); ?>"><?php _e( 'Log In' ); ?></a></p>529 <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.') ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p> 530 530 <?php 531 531 } 532 532 } -
wp-includes/canonical.php
319 319 /** This filter is documented in wp-login.php */ 320 320 $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); 321 321 } else { 322 $redirect_url = site_url( 'wp-login.php?action=register');322 $redirect_url = wp_registration_url(); 323 323 } 324 324 325 325 wp_redirect( $redirect_url, 301 ); … … 576 576 site_url( 'login', 'relative' ), 577 577 ); 578 578 if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) { 579 wp_redirect( site_url( 'wp-login.php', 'login') );579 wp_redirect( wp_login_url() ); 580 580 exit; 581 581 } 582 582 } -
wp-signup.php
28 28 add_action( 'wp_head', 'do_signup_header' ); 29 29 30 30 if ( !is_multisite() ) { 31 wp_redirect( site_url('wp-login.php?action=register') );31 wp_redirect( wp_registration_url() ); 32 32 die(); 33 33 } 34 34 … … 353 353 */ 354 354 $meta = apply_filters( 'add_signup_meta', $meta_defaults ); 355 355 356 wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); 357 confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); 356 $blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); 357 358 if ( is_wp_error( $blog_id ) ) { 359 return false; 360 } 361 362 confirm_another_blog_signup( $domain, $path, $blog_title, $blog_id, $current_user->user_login ); 358 363 return true; 359 364 } 360 365 … … 365 370 * 366 371 * @param string $domain The domain URL 367 372 * @param string $path The site root path 373 * @param string $blog_title The blog title 374 * @param string $blog_id The blog ID 368 375 * @param string $user_name The username 369 * @param string $user_email The user's email address370 * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()371 376 */ 372 function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array() ) { 377 function confirm_another_blog_signup( $domain, $path, $blog_title, $blog_id, $user_name ) { 378 switch_to_blog( $blog_id ); 379 $login_url = wp_login_url(); 380 restore_current_blog(); 373 381 ?> 374 <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>382 <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ); ?></h2> 375 383 <p> 376 <?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name )?>384 <?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, $login_url, $user_name ); ?> 377 385 </p> 378 386 <?php 379 387 /** … … 669 677 if ( $active_signup == 'none' ) { 670 678 _e( 'Registration has been disabled.' ); 671 679 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { 672 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( network_site_url( 'wp-signup.php' )) );680 $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); 673 681 echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 674 682 } else { 675 683 $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';