gentoo-overlay/www-apps/gitlabhq/files/gitlabhq-6.5.1-fix-project-name-regex.patch

28 lines
1.1 KiB
Diff

--- lib/gitlab/regex.rb.orig 2013-12-23 19:43:59.000000000 +0100
+++ lib/gitlab/regex.rb 2014-01-17 17:43:00.020000000 +0100
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Gitlab
module Regex
extend self
@@ -7,7 +9,7 @@
end
def project_name_regex
- /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
+ /\A\p{Word}[\p{Word}\-:\. ]*\z/
end
def name_regex
--- app/models/project.rb.orig 2014-01-17 17:40:02.050000000 +0100
+++ app/models/project.rb 2014-01-17 17:44:09.150000000 +0100
@@ -85,7 +85,7 @@
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,