diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /app/models/pages_domain.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) | |
download | gitlab-ce-36a59d088eca61b834191dacea009677a96c052f.tar.gz |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
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 |