From 59066b44873073dba7bf3575b7b6acf2d87d98f1 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 01:25:48 +0200 Subject: [PATCH 1/3] nameservers in registrar show with comma --- app/views/registrar/domains/partials/_nameservers.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/registrar/domains/partials/_nameservers.haml b/app/views/registrar/domains/partials/_nameservers.haml index 2ab72d95a..66ef010e6 100644 --- a/app/views/registrar/domains/partials/_nameservers.haml +++ b/app/views/registrar/domains/partials/_nameservers.haml @@ -12,6 +12,6 @@ - @data.css('hostAttr').each do |x| %tr %td= x.css('hostName').text - %td= x.css('hostAddr[ip="v4"]').text - %td= x.css('hostAddr[ip="v6"]').text + %td= Array(x.css('hostAddr[ip="v4"]')).map(&:text).join(", ") + %td= Array(x.css('hostAddr[ip="v6"]')).map(&:text).join(", ") From 74afaf46d496a16e3c3e7a815f73968e0ff78229 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 01:58:55 +0200 Subject: [PATCH 2/3] fix security --- app/models/domain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 1acc0ebd6..64b7ff5a6 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -91,7 +91,7 @@ class Domain < ActiveRecord::Base after_create :update_reserved_domains def update_reserved_domains return unless in_reserved_list? - rd = ReservedDomain.first + rd = ReservedDomain.by_domain(name).first rd.names[name] = SecureRandom.hex rd.save end From 1583d6de6cfdf139e0ee281a54fc4f3d5d588574 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 02:13:39 +0200 Subject: [PATCH 3/3] fix Nameserver security --- app/models/reserved_domain.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/reserved_domain.rb b/app/models/reserved_domain.rb index 936c744bf..09d72ec17 100644 --- a/app/models/reserved_domain.rb +++ b/app/models/reserved_domain.rb @@ -9,7 +9,9 @@ class ReservedDomain < ActiveRecord::Base class << self def pw_for(domain_name) - by_domain(domain_name).select("names -> '#{domain_name}' AS pw").first.try(:pw) + name_in_unicode = SimpleIDN.to_ascii(domain_name) + by_domain(domain_name).select("names -> '#{domain_name}' AS pw").first.try(:pw) || + by_domain(name_in_unicode).select("names -> '#{name_in_unicode}' AS pw").first.try(:pw) end def by_domain name