summaryrefslogtreecommitdiff
path: root/app/validators/project_path_validator.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-11-03 19:48:15 +0100
committerDouwe Maan <douwe@selenight.nl>2017-11-06 14:46:53 +0100
commita10925e1c37e7dab19de346c553311adfaccb86c (patch)
treeee211cc4bc6a830284a23583cd3d06e529793b10 /app/validators/project_path_validator.rb
parent97b80fefeb5da20798423b62b63fa9faa08ac118 (diff)
downloadgitlab-ce-a10925e1c37e7dab19de346c553311adfaccb86c.tar.gz
Reallow project paths ending in periodsdm-reallow-project-path-ending-in-period
Diffstat (limited to 'app/validators/project_path_validator.rb')
-rw-r--r--app/validators/project_path_validator.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/validators/project_path_validator.rb b/app/validators/project_path_validator.rb
new file mode 100644
index 00000000000..829b596ad3c
--- /dev/null
+++ b/app/validators/project_path_validator.rb
@@ -0,0 +1,19 @@
+class ProjectPathValidator < AbstractPathValidator
+ extend Gitlab::EncodingHelper
+
+ def self.path_regex
+ Gitlab::PathRegex.full_project_path_regex
+ end
+
+ def self.format_regex
+ Gitlab::PathRegex.project_path_format_regex
+ end
+
+ def self.format_error_message
+ Gitlab::PathRegex.project_path_format_message
+ end
+
+ def self.full_path(record, value)
+ record.build_full_path
+ end
+end