[wp-trac] [WordPress Trac] #18088: Network Admin Email setting in wp-admin/network/settings.php fails silently

WordPress Trac noreply at wordpress.org
Sun Nov 1 00:42:05 UTC 2015


#18088: Network Admin Email setting in wp-admin/network/settings.php fails silently
--------------------------------+----------------------------------------
 Reporter:  kawauso             |       Owner:
     Type:  defect (bug)        |      Status:  reopened
 Priority:  normal              |   Milestone:  Future Release
Component:  Networks and Sites  |     Version:  3.2
 Severity:  normal              |  Resolution:
 Keywords:  needs-patch         |     Focuses:  administration, multisite
--------------------------------+----------------------------------------

Comment (by thomaswm):

 The current behaviour is even weirder than before: If you do not enter a
 valid email address, then the network admin email will be set to the email
 address of the administrator of the site with ID 1.

 Steps to reproduce:
 * Go to `/wp-admin/network/settings.php`
 * Enter something in the email address field which is not an email address
 (for example "foo").
 * Hit the save button.
 * When the page has reloaded, this field will be filled with the value of
 `admin_email` from the site with ID 1.

 The reason is:
 * When the user saves the settings, WordPress will call
 `update_site_option` (see
 [https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-
 admin/network/settings.php#L100 line 100 in settings.php]) which then
 calls `sanitize_option`.
 * When `sanitize_option` decides that the user did not provide a valid
 email address, it will call `get_option( 'admin_email' )` and return that
 value (see [https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-
 includes/formatting.php#L3721 line 3721 in formatting.php]).
 * This value will then be saved to the network options table by
 `update_site_option`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18088#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list