Opened 7 years ago
Last modified 3 weeks ago
#47618 new defect (bug)
Email sent to blank address on email change for user with no previous email address
| Reported by: | knutsp | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Users | Version: | |
| Severity: | minor | Keywords: | has-unit-tests has-patch |
| Cc: | Focuses: |
Description
- Install/active some email logger og logging functionality for outgoing emails
- Import some content from other WP site
- Let importer create a new username for some of that content, when prompted
- Edit the newly created user and add an email address
- Observe the email log: "To:" field is empty
Expected: No email (attempted to be) sent when previous email is blank.
Change History (3)
#2
@
4 weeks ago
I put up a PR for this: https://github.com/WordPress/wordpress-develop/pull/12505
The email change notification is addressed to the old email, so an account created without one (the imported-user case in the report) has no recipient and the notification goes out to an empty address. The patch adds an empty-address guard to the condition that gates the send_email_change_email filter, so nothing is prepared or sent when there was no prior address. Includes a regression test.
One note: the password-change notification just above has the same shape (it's sent to the user's current address, also empty for these accounts). I scoped the patch to the email-change case in this ticket, but I'm happy to cover both if that's preferred.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Out of interest, does WordPress also try to send an email to this blank email address when someone leaves a comment on a post belonging to the user? Or when the user requests a password reset?