WordPress.org

Make WordPress Core

Changeset 30242


Ignore:
Timestamp:
11/05/2014 05:11:36 AM (5 years ago)
Author:
jeremyfelt
Message:

Create new $wp_roles object in install_blog() to avoid protected _init() call

Our call to $wp_roles->_init() relied on the __call() method in WP_Roles to handle the link to the protected method. This works back to PHP 5.2.9, when a bug was fixed allowing access to protected methods through this exact approach.

install_blog() needs a fresh $wp_roles object after populate_roles() resets everything in its path. We can create this new object from scratch, effectively doing the same thing with the call to _init() via the constructor.

Fixes #29692 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r30165 r30242  
    13531353    populate_options();
    13541354    populate_roles();
    1355     $wp_roles->_init();
     1355
     1356    // populate_roles() clears previous role definitions so we start over.
     1357    $wp_roles = new WP_Roles();
    13561358
    13571359    $url = untrailingslashit( $url );
Note: See TracChangeset for help on using the changeset viewer.