?
avatar hotkeeper
hotkeeper
7 Nov 2016

Steps to reproduce the issue

I tried to create a user with email address 'John.O'Connor@foo.bar.com' but the email address validation does not accept the single quote character (ASCII 39).
In the specification are the following special characters allowed:
!#$%&'*+-/=?^_`{|}~
https://en.wikipedia.org/wiki/Email_address

Expected result

The user should be created!

Actual result

Creation fails, the email address is not valid.

System information (as much as possible)

Additional comments

In the class JMailHelper (libraries/joomla/mail/helper.php) method isMailAddress() on line 130
the allowed special characters are !#$%&'*+\/=?^_`{|}~-
The ' right single quotation mark (ASCII 8217) is't an allowed character.

avatar hotkeeper hotkeeper - open - 7 Nov 2016
avatar brianteeman
brianteeman - comment - 7 Nov 2016

that is correct it is not a valid character as you have stated

On 7 November 2016 at 10:28, hotkeeper notifications@github.com wrote:

Steps to reproduce the issue

I tried to create a user with email address 'John.O'Connor@foo.bar.com'
but the email address validation does not accept the single quote character
(ASCII 39).
In the specification are the following special characters allowed:
!#$%&'*+-/=?^_`{|}~
https://en.wikipedia.org/wiki/Email_address
Expected result

The user should be created!
Actual result

Creation fails, the email address is not valid.
System information (as much as possible) Additional comments

In the class JMailHelper (libraries/joomla/mail/helper.php) method
isMailAddress() on line 130
the allowed special characters are !#$%&'*+/=?^_`{|}~-
The ' right single quotation mark (ASCII 8217) is't an allowed character.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12804, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8X7Ebi59tUlIuwITuNCCnI2yQnDPks5q7u9bgaJpZM4Kq_1X
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
https://brian.teeman.net/ http://brian.teeman.net/

avatar infograf768
infograf768 - comment - 7 Nov 2016

#39 is accepted, not #8217
Not a bug.

avatar infograf768
infograf768 - comment - 7 Nov 2016

I guess we can close this

avatar hotkeeper
hotkeeper - comment - 7 Nov 2016

The ASCII character 39 is not accepted in Joomla, but is a valid character according to the specification.
In the code it accepts ASCII character 8217 instead of 39, see code:
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/mail/helper.php#L130

avatar hotkeeper
hotkeeper - comment - 7 Nov 2016
avatar infograf768
infograf768 - comment - 8 Nov 2016

Looks like you pasted the wrong character in your description as, indeed, we do accept 8217 (’) and not 39 (')

Additional comments
In the class JMailHelper (libraries/joomla/mail/helper.php) method isMailAddress() on line 130
the allowed special characters are !#$%&'*+/=?^_`{|}~-
The ' right single quotation mark (ASCII 8217) is't an allowed character.

There must be a reason. Forgot why.

avatar infograf768
infograf768 - comment - 8 Nov 2016

This is also the case in our tests:

            array("o'reilly@there.com", false),
            array("o’reilly@there.com", true)
avatar hotkeeper
hotkeeper - comment - 8 Nov 2016

This is wrong and does not follow the specification, the character 39 should be accepted instead of 8217.
https://en.wikipedia.org/wiki/Email_address#Local-part

avatar SharkyKZ
SharkyKZ - comment - 8 Nov 2016

W3 page referenced in #4899 has single right quotation mark (ASCII 8217). That's why it was added.

avatar hotkeeper
hotkeeper - comment - 8 Nov 2016

The email address is specified in RFC-2822:

addr-spec       =       local-part "@" domain

local-part      =       dot-atom / quoted-string / obs-local-part

domain          =       dot-atom / domain-literal / obs-domain

domain-literal  =       [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS]

dcontent        =       dtext / quoted-pair

dtext           =       NO-WS-CTL /     ; Non white space controls

                        %d33-90 /       ; The rest of the US-ASCII
                        %d94-126        ;  characters not including "[",
                                        ;  "]", or "\"

https://tools.ietf.org/html/rfc2822#section-3.4.1

atext           =       ALPHA / DIGIT / ; Any character except controls,
                        "!" / "#" /     ;  SP, and specials.
                        "$" / "%" /     ;  Used for atoms
                        "&" / "'" /
                        "*" / "+" /
                        "-" / "/" /
                        "=" / "?" /
                        "^" / "_" /
                        "`" / "{" /
                        "|" / "}" /
                        "~"

atom            =       [CFWS] 1*atext [CFWS]

dot-atom        =       [CFWS] dot-atom-text [CFWS]

dot-atom-text   =       1*atext *("." 1*atext)

https://tools.ietf.org/html/rfc2822#section-3.2.4

avatar infograf768
infograf768 - comment - 8 Nov 2016

Agree. We do have this wrong from a very long time.
I am making a PR now as there are many things to touch.

avatar infograf768
infograf768 - comment - 8 Nov 2016

One sec, I post the patch

avatar infograf768
infograf768 - comment - 8 Nov 2016

Please test #12835

avatar jeckodevelopment
jeckodevelopment - comment - 8 Nov 2016

Closing since we have a patch for this.
Please test.

avatar jeckodevelopment jeckodevelopment - change - 8 Nov 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-11-08 11:58:51
Closed_By jeckodevelopment
avatar jeckodevelopment jeckodevelopment - close - 8 Nov 2016

Add a Comment

Login with GitHub to post a comment