summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-24 14:16:08 +0000
committerDouwe Maan <douwe@gitlab.com>2015-04-24 14:16:08 +0000
commitb8c4215969a45370ad37a67a8a52d16d7eeecba4 (patch)
tree523250950118f09e4b9a6cd6dbebb1350fc2cf6d /lib
parent62117f2f25646009fb5b20d7a215d7d697ce3231 (diff)
parent5f839770e720dc2f176c51d4635dceb6c34ff97a (diff)
downloadgitlab-ce-b8c4215969a45370ad37a67a8a52d16d7eeecba4.tar.gz
Merge branch 'username-period-again' into 'master'
Don't allow username to end in period. Fixes #2174 and #2249. cc @jacobvosmaer Please review and test with the GitLab.com dump. See merge request !1786
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/regex.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index 9aeed5e6939..0571574aa4f 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -2,7 +2,7 @@ module Gitlab
module Regex
extend self
- NAMESPACE_REGEX_STR = '(?:[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*)'.freeze
+ NAMESPACE_REGEX_STR = '(?:[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_\-]|[a-zA-Z0-9_])'.freeze
def namespace_regex
@namespace_regex ||= /\A#{NAMESPACE_REGEX_STR}\z/.freeze
@@ -10,7 +10,7 @@ module Gitlab
def namespace_regex_message
"can contain only letters, digits, '_', '-' and '.'. " \
- "Cannot start with '-'." \
+ "Cannot start with '-' or end in '.'." \
end