summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ. Daniel Schmidt <jdsn@suse.de>2015-04-08 15:53:07 +0200
committerJ. Daniel Schmidt <jdsn@suse.de>2015-04-08 15:54:27 +0200
commitd03cec0e697418482890f943dd5424e7a8a170be (patch)
treedb7ab1bd3e8cb76bfdec7a5b281d37612d3961af
parent706be563179c8842a9370b40c52a79256534d2a5 (diff)
downloadgitlab-ce-d03cec0e697418482890f943dd5424e7a8a170be.tar.gz
clean_path should drop all leading dashes, not just one
-rw-r--r--app/models/namespace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 8d9a85750ec..a0d79d7e5c0 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -61,7 +61,7 @@ class Namespace < ActiveRecord::Base
def clean_path(path)
path.gsub!(/@.*\z/, "")
path.gsub!(/\.git\z/, "")
- path.gsub!(/\A-/, "")
+ path.gsub!(/\A-+/, "")
path.gsub!(/\.+\z/, "")
path.gsub!(/[^a-zA-Z0-9_\-\.]/, "")