diff --git a/app/models/project.rb b/app/models/project.rb index bfab009e..5d0cdd64 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -66,7 +66,7 @@ class Project < ActiveRecord::Base validates :description, length: { within: 0..2000 } validates :name, presence: true, length: { within: 0..255 }, format: { with: Gitlab::Regex.project_name_regex, - message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } + message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter should be first" } validates :path, presence: true, length: { within: 0..255 }, format: { with: Gitlab::Regex.path_regex, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index e0fb47da..48304220 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -7,7 +7,7 @@ module Gitlab end def project_name_regex - default_regex + /\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/ end def path_regex