mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-01 19:09:12 +00:00
Create new $wp_roles object in install_blog() to avoid protected _init() call
Merges [30242] to the 4.0 branch. 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. props jeremyfelt. fixes #29692. Built from https://develop.svn.wordpress.org/branches/4.0@30255 git-svn-id: http://core.svn.wordpress.org/branches/4.0@30255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d7245bcacc
commit
b94cfff6ad
@ -1379,7 +1379,9 @@ function install_blog( $blog_id, $blog_title = '' ) {
|
|||||||
make_db_current_silent( 'blog' );
|
make_db_current_silent( 'blog' );
|
||||||
populate_options();
|
populate_options();
|
||||||
populate_roles();
|
populate_roles();
|
||||||
$wp_roles->_init();
|
|
||||||
|
// populate_roles() clears previous role definitions so we start over.
|
||||||
|
$wp_roles = new WP_Roles();
|
||||||
|
|
||||||
$url = untrailingslashit( $url );
|
$url = untrailingslashit( $url );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user