Ticket #25350: 25350.03.patch
File 25350.03.patch, 3.5 KB (added by , 12 years ago) |
---|
-
src/wp-activate.php
52 52 add_action( 'wp_head', 'wpmu_activate_stylesheet' ); 53 53 54 54 get_header(); 55 56 $key_param = wp_activation_key_param(); 57 $get_activation_key = false; 58 if ( ! empty( $_GET[ $key_param ] ) ) { 59 $get_activation_key = urldecode( $_GET[ $key_param ] ); 60 } else if ( ! empty( $_GET['key'] ) ) { 61 // Backward compatibility 62 $get_activation_key = urldecode( $_GET['key'] ); 63 } 64 55 65 ?> 56 66 57 67 <div id="content" class="widecolumn"> 58 <?php if ( empty( $_GET['key']) && empty($_POST['key']) ) { ?>68 <?php if ( empty( $get_activation_key ) && empty($_POST['key']) ) { ?> 59 69 60 70 <h2><?php _e('Activation Key Required') ?></h2> 61 71 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>"> … … 70 80 71 81 <?php } else { 72 82 73 $key = ! empty($_GET['key']) ? $_GET['key']: $_POST['key'];83 $key = ! empty( $get_activation_key ) ? $get_activation_key : $_POST['key']; 74 84 $result = wpmu_activate_signup($key); 75 85 if ( is_wp_error($result) ) { 76 86 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { … … 116 126 var key_input = document.getElementById('key'); 117 127 key_input && key_input.focus(); 118 128 </script> 119 <?php get_footer(); ?> 120 No newline at end of file 129 <?php get_footer(); ?> -
src/wp-includes/ms-functions.php
714 714 if ( !apply_filters('wpmu_signup_blog_notification', $domain, $path, $title, $user, $user_email, $key, $meta) ) 715 715 return false; 716 716 717 $key_param = wp_activation_key_param(); 718 717 719 // Send email with activation link. 718 720 if ( !is_subdomain_install() || $current_site->id != 1 ) 719 $activate_url = network_site_url("wp-activate.php? key=$key");721 $activate_url = network_site_url("wp-activate.php?$key_param=$key"); 720 722 else 721 $activate_url = "http://{$domain}{$path}wp-activate.php? key=$key"; // @todo use *_url() API723 $activate_url = "http://{$domain}{$path}wp-activate.php?$key_param=$key"; // @todo use *_url() API 722 724 723 725 $activate_url = esc_url($activate_url); 724 726 $admin_email = get_site_option( 'admin_email' ); … … 773 775 if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) ) 774 776 return false; 775 777 778 $key_param = wp_activation_key_param(); 779 776 780 // Send email with activation link. 777 781 $admin_email = get_site_option( 'admin_email' ); 778 782 if ( $admin_email == '' ) … … 784 788 __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ), 785 789 $user, $user_email, $key, $meta 786 790 ), 787 site_url( "wp-activate.php? key=$key" )791 site_url( "wp-activate.php?$key_param=$key" ) 788 792 ); 789 793 // TODO: Don't hard code activation link. 790 794 $subject = sprintf( … … 2059 2063 2060 2064 return $site_results; 2061 2065 } 2066 2067 /** 2068 * Return the URL parameter to use for activation keys 2069 * 2070 * @since 3.7.0 2071 * 2072 * @return string The activation key paramater. Defaults to 'k'. 2073 */ 2074 function wp_activation_key_param() { 2075 /** 2076 * Filter the URL parameter to use for activation keys 2077 * 2078 * @since 3.7.0 2079 * @param string The activation key parameter. 2080 */ 2081 return urlencode( apply_filters( 'wp_activation_key_param', 'k' ) ); 2082 }