diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2015-02-09 00:01:31 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2015-04-27 16:38:47 +0200 |
commit | a1c01bc19bb48e921566304305ef3cfba02e671b (patch) | |
tree | 2f103b8bcec585430988ba07af99af450611dffa /lib | |
parent | bb8c1cadf39415d2f916d135e8bbfdce49842f2f (diff) | |
download | gitlab-ce-a1c01bc19bb48e921566304305ef3cfba02e671b.tar.gz |
Fix (project_)name_regex to accept non-ASCII letters and dash
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/regex.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index 0571574aa4f..9f1adc860d1 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -15,20 +15,20 @@ module Gitlab def namespace_name_regex - @namespace_name_regex ||= /\A[a-zA-Z0-9_\-\. ]*\z/.freeze + @namespace_name_regex ||= /\A[\p{Alnum}\p{Pd}_\. ]*\z/.freeze end def namespace_name_regex_message - "can contain only letters, digits, '_', '-', '.' and space." + "can contain only letters, digits, '_', '.', dash and space." end def project_name_regex - @project_name_regex ||= /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\. ]*\z/.freeze + @project_name_regex ||= /\A[\p{Alnum}_][\p{Alnum}\p{Pd}_\. ]*\z/.freeze end def project_name_regex_message - "can contain only letters, digits, '_', '-', '.' and space. " \ + "can contain only letters, digits, '_', '.', dash and space. " \ "It must start with letter, digit or '_'." end |