Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#9316 closed enhancement (fixed)

More robust is_email() and sanitize_email() functions

Reported by: sambauers's profile sambauers Owned by:
Milestone: 2.8 Priority: low
Severity: minor Version: 2.7.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

Attached patch includes robust and filterable is_email() and sanitize_email() functions.

These functions split up the validation into distinct stages rather than trying to use a single PCRE function. The reason for failure is made available via the filters.

Also included in is_email() is an optional DNS check (where supported by PHP).

Although not quite RFC compliant, it addresses most of the issues in #4616, and also allows easier filtering for those who want to implement RFC compliance via plugins.

Attachments (2)

better_email_checks.diff (5.5 KB) - added by sambauers 15 years ago.
Regexp-Fix.diff (536 bytes) - added by sambauers 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ryan
15 years ago

  • Milestone changed from Unassigned to 2.8

#2 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10769]) Improved is_email() and sanitize_email(). Props sambauers. fixes #9316 #4616

#3 @azaozz
15 years ago

(In [10777]) Fix regex function in sanitize_email(), see #9316

#4 @sambauers
15 years ago

Patch to fix the fix!

#5 @azaozz
15 years ago

(In [10783]) Fix regex in sanitize_email(), props sambauers, see #9316

Note: See TracTickets for help on using tickets.