Ticket #25350: 25350.04.patch
File 25350.04.patch, 3.6 KB (added by , 11 years ago) |
---|
-
src/wp-activate.php
52 52 add_action( 'wp_head', 'wpmu_activate_stylesheet' ); 53 53 54 54 get_header(); 55 56 //duplicate_hook 57 $key_param = apply_filters( 'wp_activate_key_param', 'k' ); 58 59 $activation_key = false; 60 if ( ! empty( $_REQUEST[ $key_param ] ) ) { 61 $activation_key = urldecode( $_GET[ $key_param ] ); 62 } else if ( ! empty( $_REQUEST['key'] ) ) { 63 // Backward compatibility 64 $activation_key = urldecode( $_REQUEST['key'] ); 65 } 66 55 67 ?> 56 68 57 69 <div id="content" class="widecolumn"> 58 <?php if ( empty( $_GET['key']) && empty($_POST['key']) ) { ?>70 <?php if ( empty( $activation_key ) ) { ?> 59 71 60 72 <h2><?php _e('Activation Key Required') ?></h2> 61 73 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>"> 62 74 <p> 63 75 <label for="key"><?php _e('Activation Key:') ?></label> 64 <br /><input type="text" name=" key" id="key" value="" size="50" />76 <br /><input type="text" name="<?php echo esc_attr( $key_param ) ?>" id="key" value="" size="50" /> 65 77 </p> 66 78 <p class="submit"> 67 79 <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" /> … … 70 82 71 83 <?php } else { 72 84 73 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key']; 74 $result = wpmu_activate_signup($key); 85 $result = wpmu_activate_signup( $activation_key ); 75 86 if ( is_wp_error($result) ) { 76 87 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { 77 88 $signup = $result->get_error_data(); … … 116 127 var key_input = document.getElementById('key'); 117 128 key_input && key_input.focus(); 118 129 </script> 119 <?php get_footer(); ?> 120 No newline at end of file 130 <?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 /** 718 * Filter the URL parameter to use for activation keys 719 * 720 * @since 3.7.0 721 * @param string The activation key parameter. 722 */ 723 $key_param = apply_filters( 'wp_activate_key_param', 'k' ); 724 717 725 // Send email with activation link. 718 726 if ( !is_subdomain_install() || $current_site->id != 1 ) 719 $activate_url = network_site_url("wp-activate.php? key=$key");727 $activate_url = network_site_url("wp-activate.php?$key_param=$key"); 720 728 else 721 $activate_url = "http://{$domain}{$path}wp-activate.php? key=$key"; // @todo use *_url() API729 $activate_url = "http://{$domain}{$path}wp-activate.php?$key_param=$key"; // @todo use *_url() API 722 730 723 731 $activate_url = esc_url($activate_url); 724 732 $admin_email = get_site_option( 'admin_email' ); … … 773 781 if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) ) 774 782 return false; 775 783 784 //duplicate_hook 785 $key_param = apply_filters( 'wp_activate_key_param', 'k' ); 786 776 787 // Send email with activation link. 777 788 $admin_email = get_site_option( 'admin_email' ); 778 789 if ( $admin_email == '' ) … … 784 795 __( "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 796 $user, $user_email, $key, $meta 786 797 ), 787 site_url( "wp-activate.php? key=$key" )798 site_url( "wp-activate.php?$key_param=$key" ) 788 799 ); 789 800 // TODO: Don't hard code activation link. 790 801 $subject = sprintf(