Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/minimist-1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
karlwilbur committed Nov 9, 2022
2 parents 95deba8 + 619ac47 commit 7c75838
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions lib/email_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def address_literal

def host_label_pattern
"#{label_is_correct_length}" \
"#{label_contains_no_more_than_one_consecutive_hyphen}" \
"#{alnum}(?:#{alnumhy}{,61}#{alnum})?"
end

Expand Down Expand Up @@ -123,10 +122,6 @@ def domain_part_is_correct_length
'(?=.{1,255}$)'
end

def label_contains_no_more_than_one_consecutive_hyphen
'(?!.*?--.*$)'
end

def atom_char
# The `atext` spec
# We are looking at this without whitespace; no whitespace support here
Expand Down
5 changes: 3 additions & 2 deletions spec/email_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class DefaultUserWithMessage < TestModel
'john.doe@2020.a-z.com',
'john.doe@2020.a2z.com',
'john.doe@2020.12345a6789.com',
'jonh.doe@163.com'
'jonh.doe@163.com',
'test@umläut.com', # non-ASCII
'test@xn--umlut-ira.com' # ASCII-compatibale encoding of non-ASCII
]).flatten.each do |email|
context 'when using defaults' do
it "'#{email}' should be valid" do
Expand Down Expand Up @@ -477,7 +479,6 @@ class DefaultUserWithMessage < TestModel
'host-beginning-with-dot@.example.com',
'domain-beginning-with-dash@-example.com',
'domain-ending-with-dash@example-.com',
'domain-contains-double-dash@foo--example.com',
'the-local-part-is-invalid-if-it-is-longer-than-sixty-four-characters@sld.dev',
"domain-too-long@t#{".#{'o' * 63}" * 5}.long",
"user@example.com<script>alert('hello')</script>"
Expand Down

0 comments on commit 7c75838

Please sign in to comment.