mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Remove comment
This commit is contained in:
parent
c07dffe7cc
commit
d0251de28f
2 changed files with 4 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -20,3 +20,5 @@ config/secrets.yml
|
|||
|
||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||
.rvmrc
|
||||
|
||||
.rubocop.yml
|
||||
|
|
|
@ -16,7 +16,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
def validate(value)
|
||||
value = value.mb_chars.downcase.strip
|
||||
|
||||
general_domains = /(.pri.ee|.com.ee|.fie.ee|.med.ee|.ee)/ #TODO Add more general domains here
|
||||
general_domains = /(.pri.ee|.com.ee|.fie.ee|.med.ee|.ee)/
|
||||
|
||||
# it's punycode
|
||||
if value[2] == '-' && value[3] == '-'
|
||||
|
@ -25,7 +25,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
value = SimpleIDN.to_unicode(value).mb_chars.downcase.strip
|
||||
end
|
||||
|
||||
unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ #äõöüšž
|
||||
unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ # äõöüšž
|
||||
regexp = /\A[a-zA-Z0-9#{unicode_chars}][a-zA-Z0-9#{unicode_chars}-]{0,61}[a-zA-Z0-9#{unicode_chars}]#{general_domains}\z/
|
||||
|
||||
!!(value =~ regexp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue