`wpmu_activate_signup()` returns an `array` or `WP_Error`. The array keys it returns can be different based on context of `$signup`. The return value was previously `extract()`'d, so the value of `$blog_id` was secretly undefined when being passed to `get_blogaddress_by_id()` in some cases.

If `$result['blog_id']` is not set, make sure `$url` is set to an empty string so that the proper "activated" message is shown to the user.

Props imath.
See [28373].
Fixes #29191.


git-svn-id: https://develop.svn.wordpress.org/trunk@29554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-20 17:29:36 +00:00
parent 8e7c9b7d58
commit 21a7e91fbd
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ get_header();
echo '<p>'.$result->get_error_message().'</p>';
}
} else {
$url = get_blogaddress_by_id( (int) $result['blog_id'] );
$url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int) $result['blog_id'] ) : '';
$user = get_userdata( (int) $result['user_id'] );
?>
<h2><?php _e('Your account is now active!'); ?></h2>
@ -115,7 +115,7 @@ get_header();
<p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $result['password']; ?></p>
</div>
<?php if ( $url != network_home_url('', 'http') ) : ?>
<?php if ( $url && $url != network_home_url( '', 'http' ) ) : ?>
<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>
<?php else: ?>
<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>