diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 00:09:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 00:09:24 +0000 |
commit | 2711c26beaca6c3a5a3be4b65e01557faf0185b6 (patch) | |
tree | 25d0c2ddb47e87712044884f558a9104c686805f /app/models/application_setting.rb | |
parent | 8a7aaf86831d2a556578ae558a4fcab8bb659b20 (diff) | |
download | gitlab-ce-2711c26beaca6c3a5a3be4b65e01557faf0185b6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 481e1807a78..3d55269e36f 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -257,7 +257,7 @@ class ApplicationSetting < ApplicationRecord validates :snippet_size_limit, numericality: { only_integer: true, greater_than: 0 } - validate :email_restrictions_regex_valid? + validates :email_restrictions, untrusted_regexp: true SUPPORTED_KEY_TYPES.each do |type| validates :"#{type}_key_restriction", presence: true, key_restriction: { type: type } @@ -411,14 +411,6 @@ class ApplicationSetting < ApplicationRecord recaptcha_enabled || login_recaptcha_protection_enabled end - def email_restrictions_regex_valid? - return if email_restrictions.blank? - - Gitlab::UntrustedRegexp.new(email_restrictions) - rescue RegexpError - errors.add(:email_restrictions, _('is not a valid regular expression')) - end - private def parsed_grafana_url |