diff options
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r-- | app/models/pages_domain.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 2804588be85..93119bbff1f 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -245,8 +245,9 @@ class PagesDomain < ApplicationRecord def validate_pages_domain return unless domain - if domain.downcase.ends_with?(".#{Settings.pages.host.downcase}") || domain.casecmp(Settings.pages.host) == 0 - self.errors.add(:domain, "#{Settings.pages.host} and its subdomains cannot be used as custom pages domains. Please compare our documentation at https://docs.gitlab.com/ee/administration/pages/#advanced-configuration against your configuration.") + if domain.downcase.ends_with?(".#{Settings.pages.host.downcase}") + error_template = _("Subdomains of the Pages root domain %{root_domain} are reserved and cannot be used as custom Pages domains.") + self.errors.add(:domain, error_template % { root_domain: Settings.pages.host }) end end |