Skip to content

Commit

Permalink
[api] backend discards project names with :: - so should the api
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Nov 20, 2013
1 parent 5641467 commit 775b9c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ def self.valid_name?(name)
# this length check is duplicated but useful for other uses for this function
return false if name.length > 200 || name.blank?
return false if name =~ %r{^[_\.]}
return false if name =~ %r{::}
return true if name =~ /\A\w[-+\w\.:]*\z/
return false
end
Expand Down
5 changes: 4 additions & 1 deletion src/api/test/unit/project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def put_flags(flags)
end
end


test 'invalid names' do
# no ::
assert !Project.valid_name?('home:M0ses:raspi::qtdesktop')
end
end


0 comments on commit 775b9c4

Please sign in to comment.