`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.

Built from https://develop.svn.wordpress.org/trunk@29554


git-svn-id: http://core.svn.wordpress.org/trunk@29329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-20 17:30:16 +00:00
parent 9f91625fb6
commit dc4d08e032
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>