WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#17491 reopened defect (bug)

Make is_email() compliant with RFC2822

Reported by: arena Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version: 3.1.2
Component: Formatting Keywords: has-patch dev-feedback is-email
Focuses: Cc:

Description (last modified by kawauso)

is_email('toto.@…') returns true

Attachments (2)

17491.diff (538 bytes) - added by sivel 6 years ago.
#17491.patch (5.4 KB) - added by arena 6 years ago.
new patch

Download all attachments as: .zip

Change History (24)

#1 @arena
6 years ago

toto.@… does not comply with RFC 2822

#2 @scribu
6 years ago

  • Keywords needs-patch added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release
  • Severity changed from critical to minor
  • Summary changed from is_email('toto.@toto.com') returns true !!!! to is_email('toto.@toto.com') returns true

Let's not get carried away.

@sivel
6 years ago

#3 @sivel
6 years ago

  • Keywords has-patch added; needs-patch removed

Patch adds in the rest of the regex from http://www.regular-expressions.info/email.html for the local part.

#4 @scribu
6 years ago

  • Milestone changed from Future Release to 3.2

#5 @ryan
6 years ago

  • Milestone changed from 3.2 to Future Release

#6 @arena
6 years ago

  • Keywords dev-feedback added

Here is a new fix (#17491.patch) with code from the class swiftmailer

http://swiftmailer.org

to comply with RFC2822

@arena
6 years ago

new patch

#7 follow-up: @arena
6 years ago

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

duplicate with #19759

#8 in reply to: ↑ 7 ; follow-up: @kawauso
6 years ago

Replying to arena:

duplicate with #19759

Are we closing an existing ticket with feedback and milestone in favour of a new one with a similar patch and issue or am I missing something?

#9 in reply to: ↑ 8 @helenyhou
6 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Replying to kawauso:

Are we closing an existing ticket with feedback and milestone in favour of a new one with a similar patch and issue or am I missing something?

I think arena may be trying to bump the ticket. Closing #19759 as duplicate - patch is exactly the same as #17491.patch.

#10 @arena
6 years ago

my purpose was not to bump but to clarify the situation with a more specific title : making is_email() compliant with rfc2822.

#11 @helenyhou
6 years ago

  • Summary changed from is_email('toto.@toto.com') returns true to Make is_email() compliant with RFC2822

#12 @arena
6 years ago

  • Summary changed from Make is_email() compliant with RFC2822 to Make is_email() compliant with RFC2822 !

#13 @kawauso
6 years ago

  • Description modified (diff)
  • Summary changed from Make is_email() compliant with RFC2822 ! to Make is_email() compliant with RFC2822

No need, really. Especially for those of us with email threads.

#14 follow-up: @miqrogroove
5 years ago

Have you considered simply adopting the Google solution? They offer a free PHP script for e-mail syntax validation.

#15 in reply to: ↑ 14 @arena
5 years ago

Replying to miqrogroove:

Have you considered simply adopting the Google solution? They offer a free PHP script for e-mail syntax validation.

any link to check that 'magic' google code , thanks

#17 @rmccue
5 years ago

(Worth noting that's not actually a Google-written piece of code, it's just hosted on Google Code.)

#19 @SergeyBiryukov
4 years ago

  • Component changed from General to Mail

Related: #25108

#20 @dd32
3 years ago

#17678 was marked as a duplicate.

#21 @dd32
3 years ago

#17678 proposed this package: http://code.google.com/p/isemail/ (BSD-licensed and unit-tested)

Personally I don't see a huge need to add a 100% RFC compliant heavy package to do email validation, I'd rather stick to the side of fast, small, simple - That being said, I admit email validation doesn't follow that.

We already Test for leading and trailing periods and whitespace in the $domain part of the email, if we were to extend that to the $local part of the email we'd cover the original issue here (and one that i've seen quite often).

Last edited 3 years ago by dd32 (previous) (diff)

#22 @miqrogroove
2 years ago

  • Component changed from Mail to Formatting
  • Keywords is-email added
Note: See TracTickets for help on using tickets.