BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
17ea019f
Commit
17ea019f
authored
Dec 26, 2012
by
Andrey Kumanyaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Project name validation
parent
c4536ae5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
project.rb
app/models/project.rb
+3
-1
regex.rb
lib/gitlab/regex.rb
+4
-0
No files found.
app/models/project.rb
View file @
17ea019f
...
...
@@ -64,7 +64,9 @@ class Project < ActiveRecord::Base
# Validations
validates
:owner
,
presence:
true
validates
:description
,
length:
{
within:
0
..
2000
}
validates
:name
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:name
,
presence:
true
,
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
project_name_regex
,
message:
"only letters, digits & '_' '-' '.' 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"
}
...
...
lib/gitlab/regex.rb
View file @
17ea019f
...
...
@@ -6,6 +6,10 @@ module Gitlab
default_regex
end
def
project_name_regex
default_regex
end
def
path_regex
default_regex
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment