Make WordPress Core

Opened 3 years ago

Last modified 2 months ago

#17890 new defect (bug)

"Add New Site" screen reports invalid email addresses as missing

Reported by: kawauso Owned by:
Milestone: Future Release Priority: low
Severity: normal Version: 3.1.3
Component: Networks and Sites Keywords: has-patch commit 3.9-early
Focuses: multisite, administration Cc:


The new site user's email is passed through sanitize_email() and the screen dies with 'Missing email address.' if it's empty().

sanitize_email() returns an empty string (subject to filtering) on invalid email addresses however, so the following is_email() check for invalid email addresses is never even reached.

Steps to reproduce:

  1. Add a new site with an email address such as foo@bar

Attachments (2)

17890.diff (854 bytes) - added by kawauso 3 years ago.
No is_email(), move sanitize_email() later
17890.2.diff (996 bytes) - added by jeremyfelt 5 months ago.

Download all attachments as: .zip

Change History (6)

kawauso3 years ago

No is_email(), move sanitize_email() later

comment:1 kawauso3 years ago

  • Keywords has-patch added

Patch moves sanitize_email() call after if checking email is empty. Also removes is_email() call since it performs much the same checks.

jeremyfelt5 months ago

comment:2 jeremyfelt5 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

Confirmed behavior. This is a pretty strange error message to toss up when an invalid email is entered.

17890.2.diff continues to use is_email(), as there is just enough difference in functionality and we should continue to respect the filters that may be extending that. The sanitize_email() use is moved down a bit after we check for a completely missing email address.

comment:3 SergeyBiryukov5 months ago

  • Keywords commit 3.9-early added

comment:4 nacin2 months ago

  • Component changed from Network Admin to Networks and Sites
  • Focuses administration added
Note: See TracTickets for help on using tickets.