User tests: Successful: Unsuccessful:
The url http://www.w3.org/TR/html-markup/input.email.html did not exist any more. The correct url is now https://www.w3.org/TR/html/sec-forms.html#email-state-typeemail
The label of an email
1*( atext / "." ) "@" label *( "." label )
is limited to a length of 63 characters by RFC 1034 section 3.5 (https://tools.ietf.org/html/rfc1034#section-3.5)
Create an user and use an email address with more than 63 characters. For example
test@1234abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz.org
test@test.1234abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz
test@1234abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz.example.org
I expect to see a warning and the email address should not be saved.
No warning and the email address is saved.
If you apply this patch, you see the warning and the email address is not saved if you use an email address with more than 63 characters for label.
If you use an email address with less than 63 characters, for example
test@123abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz.org
test@test.123abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz
test@123abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyz.example.org
the email address is saved.
No
If you install Joomla, the email field is marked an invalid field, when you click in step 3 on "Install Joomla", but you see no warning that explains why the field is marked as invalid.
The same goes for Joomla version 3.
Addition: If we merge this we should do this for media/system/js/validate-uncompressed.js, too.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Personally I would remove the email regex completely.and simply use the native PHP filter_var
Me, too, but
filter_var (FILTER_VALIDATE_EMAIL) doesn't support dotless domains.
https://secure.php.net/manual/en/filter.filters.validate.php
E.g. in a local environment dotless domains are common.
so take the other option - remove all validation. Leave it to the user to make sure they type their own email address correctly. The internet wastes far too much time writing regex for emails and then updating them etc etc
I was looking to see what has changed since j3
In J3 all validation was done by validation.js (which did have the character count)
It looks to me that the removal of that script is exposing a lot of different errors and instead of them all being reported one at a time - everything that was tested with validation.js in J3 should be checked in J4. Otherwise we are just adding bandaids
Labels |
Removed:
J4 Issue
|
@sanderpotjer Done
@astridx thanks! With the merge this change is lost:
The url http://www.w3.org/TR/html-markup/input.email.html did not exist any more. The correct url is now https://www.w3.org/TR/html/sec-forms.html#email-state-typeemail
I'm not good at resolving conflicts. Is there any interest for this function? Then I would close this PR and open a new one.
@sanderpotjer Thank you
I have tested this item
When creating an user with an invalid email address (e.g. test@123abcdefghijklmnopqrstuvwyz0123456789abcdefghijklmnopqrstuvwyzzzz.org, label has length of 66), the warning is shown but the user is still saved.
I would extend the problem of PR a bit more. The problem also occurs when updating a user.
After Click on the Save User Button (update)
System
PHP Build On: Windows NT 10.0 build 18362 (Windows 10) i586
10.1.37-MariaDB
PHP-Version: 7.3.0
Webserver: Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.3.0
Joomla! Version: Joomla! 4.0.0-alpha12-dev Development [ Amani ] 19-August-2019 13:40 GMT
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
@eXsiLe95 Thank you for testing.
I just tested it myself again and you're right. The warning appears. The user is saved despite the warning.
Now I do not know how to continue. For my understanding, the user should not be saved if the RegX does not fit. And the RegX does not fit, because of the warning. The user was not saved when I created this PR. Is it possible that something else is wrong with the server-side validation?
@Schmidie64 You are right. I will do this, if this Pr is accepted :).
I have tested this item
after applying patch, user still getting the warning and user also get saved.
I have tested this item
I have tested this item
@astridx Per your comment #19300 (comment)
Labels |
Added:
?
|
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-16 15:58:50 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
?
Removed: ? |
Thanks.
Personally I would remove the email regex completely.and simply use the native PHP filter_var