Opened 10 months ago
Last modified 5 months ago
#21537 new defect (bug)
Email address sanitisation mangles valid email addresses
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | 3.4.1 |
| Severity: | normal | Keywords: | needs-patch 2nd-opinion |
| Cc: | westi, beau@…, yoavf, joachim.kudish@…, ian_dunn@… |
Description
If you change your email address to one including an ampersand then we mangle the address with html entities.
For example:
- This - peter&paul@…
- Becomes - peter&paul@…
This is due to the call to wp_filter_kses on pre_user_email' in default-filters.php.
The was added in [5906] for #4546.
I'm not sure if we need kses filtering for emails - if we do which should probably revert this conversion of the & => & afterwards.
Change History (6)
comment:1
beaulebens
— 10 months ago
- Cc beau@… added
comment:3
wonderboymusic
— 9 months ago
Related: #16788
comment:6
iandunn
— 5 months ago
What about instead of applying wp_filter_kses, we pass the new address through PHP's FILTER_SANITIZE_EMAIL? That would strip out all characters except letters, digits and !#$%&'*+-/=?^_`{|}~@.[]
While we're in there, there are some other rules that might need to be considered:
\"").
From http://en.wikipedia.org/wiki/Email_address which summarizes http://tools.ietf.org/html/rfc3696#section-3