[wp-trac] [WordPress Trac] #43390: get_super_admins() should not return "admin" by default

WordPress Trac noreply at wordpress.org
Fri Feb 23 01:29:47 UTC 2018


#43390: get_super_admins() should not return "admin" by default
--------------------------------+-----------------------------
 Reporter:  thomaswm            |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 The function `get_super_admins()`, introduced in [14206], returns an array
 of users with network admin capabilities. Those are stored in the
 `site_admins` network option.

 If, for any reason, that network option does not exist,
 `get_super_admins()` will return a one-element array containing
 ''"admin"'' instead.

 See [https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
 includes/capabilities.php#L761 line 761] in `wp-
 includes/capabilities.php`.

 {{{#!php
 return get_site_option( 'site_admins', array('admin') );
 }}}

 This goes back to a time when `admin` was the default username for the
 first WordPress user. Since administrators are now discouraged from using
 ''admin'' as a username, `get_super_admins()` should return an empty array
 by default:

 {{{#!php
 return get_site_option( 'site_admins', array() );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43390>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list