Make WordPress Core

Changeset 29554


Ignore:
Timestamp:
08/20/2014 05:29:36 PM (10 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-activate.php

    r28500 r29554  
    106106            }
    107107        } else {
    108             $url = get_blogaddress_by_id( (int) $result['blog_id'] );
     108            $url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int) $result['blog_id'] ) : '';
    109109            $user = get_userdata( (int) $result['user_id'] );
    110110            ?>
     
    116116            </div>
    117117
    118             <?php if ( $url != network_home_url('', 'http') ) : ?>
     118            <?php if ( $url && $url != network_home_url( '', 'http' ) ) : ?>
    119119                <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>
    120120            <?php else: ?>
Note: See TracChangeset for help on using the changeset viewer.