Skip to content

Commit 890ec11

Browse files
committed
Clear the site_admins network option before filling it
During initial installation, it's possible for the `site_admins` meta key to be left blank and for a new meta key/value store to be created after that one is misread. We should delete this option during installation before recreating it with the current user performing the install.
1 parent 41db0b2 commit 890ec11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

install.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated
3434
install_network();
3535
populate_network( 1, $domain, $user_email, 'jQuery Network', $base, false );
3636

37-
update_site_option( 'site_admins', array( $user->user_login ) );
37+
delete_site_option( 'site_admins' );
38+
add_site_option( 'site_admins', array( $user->user_login ) );
39+
3840
update_site_option( 'allowedthemes', array() );
3941

4042
$wpdb->insert( $wpdb->blogs, array( 'site_id' => 1, 'domain' => $domain, 'path' => $base, 'registered' => current_time( 'mysql' ) ) );

0 commit comments

Comments
 (0)