summaryrefslogtreecommitdiff
path: root/app/validators/dynamic_path_validator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/dynamic_path_validator.rb')
-rw-r--r--app/validators/dynamic_path_validator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/validators/dynamic_path_validator.rb b/app/validators/dynamic_path_validator.rb
index 6819886ebf4..27ac60637fd 100644
--- a/app/validators/dynamic_path_validator.rb
+++ b/app/validators/dynamic_path_validator.rb
@@ -6,16 +6,21 @@
# Values are checked for formatting and exclusion from a list of illegal path
# names.
class DynamicPathValidator < ActiveModel::EachValidator
+ extend Gitlab::EncodingHelper
+
class << self
def valid_user_path?(path)
+ encode!(path)
"#{path}/" =~ Gitlab::PathRegex.root_namespace_path_regex
end
def valid_group_path?(path)
+ encode!(path)
"#{path}/" =~ Gitlab::PathRegex.full_namespace_path_regex
end
def valid_project_path?(path)
+ encode!(path)
"#{path}/" =~ Gitlab::PathRegex.full_project_path_regex
end
end