Skip to content

Commit

Permalink
wpmu_activate_signup() returns an array or WP_Error. The array …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
staylor committed Aug 20, 2014
1 parent 9f91625 commit dc4d08e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-activate.php
Expand Up @@ -105,7 +105,7 @@ function wpmu_activate_stylesheet() {
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>
Expand All @@ -115,7 +115,7 @@ function wpmu_activate_stylesheet() {
<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>
Expand Down

0 comments on commit dc4d08e

Please sign in to comment.