2014-05-19 13:22:58 +02:00
|
|
|
--- lib/gitlab/regex.rb.orig 2014-05-19 12:17:42.210000000 +0200
|
|
|
|
+++ lib/gitlab/regex.rb 2014-05-19 12:18:56.920000000 +0200
|
2014-05-18 18:53:48 +02:00
|
|
|
@@ -1,3 +1,5 @@
|
|
|
|
+# encoding: utf-8
|
|
|
|
+
|
|
|
|
module Gitlab
|
|
|
|
module Regex
|
|
|
|
extend self
|
|
|
|
@@ -7,7 +9,7 @@
|
|
|
|
end
|
|
|
|
|
|
|
|
def project_name_regex
|
2014-05-19 13:22:58 +02:00
|
|
|
- /\A[a-zA-Z0-9_][a-zA-Z0-9_\-\. ]*\z/
|
|
|
|
+ /\A[\p{Word}_][\p{Word}_\-:\. ]*\z/
|
2014-05-18 18:53:48 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def name_regex
|
2014-05-19 13:22:58 +02:00
|
|
|
--- app/models/project.rb.orig 2014-05-19 12:19:44.700000000 +0200
|
|
|
|
+++ app/models/project.rb 2014-05-19 12:20:16.050000000 +0200
|
|
|
|
@@ -84,7 +84,7 @@
|
2014-05-18 18:53:48 +02:00
|
|
|
validates :description, length: { maximum: 2000 }, allow_blank: true
|
|
|
|
validates :name, presence: true, length: { within: 0..255 },
|
|
|
|
format: { with: Gitlab::Regex.project_name_regex,
|
|
|
|
- message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" }
|
|
|
|
+ message: "only letters, digits, spaces & '_' '-' '.' ':' allowed. Letter or digit should be first" }
|
|
|
|
validates :path, presence: true, length: { within: 0..255 },
|
|
|
|
exclusion: { in: Gitlab::Blacklist.path },
|
|
|
|
format: { with: Gitlab::Regex.path_regex,
|