Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#9316 closed enhancement (fixed)

More robust is_email() and sanitize_email() functions

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

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 18 years ago.
Regexp-Fix.diff (536 bytes ) - added by sambauers 17 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ryan
18 years ago

  • Milestone Unassigned2.8

#2 @ryan
18 years ago

  • Resolutionfixed
  • Status newclosed

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

#3 @azaozz
18 years ago

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

#4 @sambauers
17 years ago

Patch to fix the fix!

#5 @azaozz
17 years ago

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

Note: See TracTickets for help on using tickets.