Comments (6)
Yeah, I see what you are saying. International Domain Names (IDN), when ASCII-Compatible Encoded (ACE), are getting double dashes in them. I think that is why they are getting rejected in strict
mode.
from email_validator.
https://github.com/K-and-R/email_validator/blob/develop/lib/email_validator.rb#L126-L128
I expected GitHub this to include the lines of code (below) just by adding in the link to them (above). It did not, so here they are:
def label_contains_no_more_than_one_consecutive_hyphen
'(?!.*?--.*$)'
end
from email_validator.
So, this behavior is very much intentional, but may be a mistake. Let me look at the RFC again.
from email_validator.
So, I am thinking that rejecting consecutive hyphens was my mistake. I cannot see where they are not allowed in domain names.
I do see that India's Domain Registration Service does say that:
Two hyphens together is usually not permitted and also hyphens cannot appear at both third and fourth positions.
In fact, RFC 3696 clearly indicates that double hyphens preceded by "xn" should be expected.
(https://www.rfc-editor.org/rfc/rfc3696#section-5)
So, definitely a bug.
Thank you for bringing it to my attention.
from email_validator.
@manuelmeurer Fixed in version 2.2.4
from email_validator.
Brilliant, thanks so much for the quick fix!
from email_validator.
Related Issues (20)
- Is there any way to validate custom domain email? HOT 3
- Security Warning HOT 3
- Alternative gem: email_address HOT 1
- Validation not catching jdoe@example-com HOT 3
- Semicolon and emails with not tld in email addresses in version 2.0.1 HOT 2
- Rails 6 support HOT 5
- Error when putting code in model HOT 1
- Alternative gem: email_verifier
- It is allowing invalid emails HOT 13
- Badge points to other repo HOT 2
- 2020.example.com is a valid fqdn HOT 8
- Valid numeric domains are considered invalid in strict mode HOT 2
- TravisCI Builds are failing for ppc64le+ruby 2.4 HOT 3
- Add rspec matcher
- Alternative gem: validates_email_format_of
- More disposable domains
- [CodeClimate] Class EmailValidator has 25 methods (exceeds 20 allowed)
- [CodeClimate] Method valid? has a Cognitive Complexity of 6 (exceeds 5 allowed).
- .tech domains
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email_validator.