Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-04-15 16:30:50 +0300
committerRémy Coutable <remy@rymai.me>2019-04-15 16:30:50 +0300
commitb40ea0f1e2f2a7bb804b2181b87d74a75454f62b (patch)
treefc40d8bd471b7639fa2888afa9ef2ad4c1d0a321 /lib
parentb15a78dfdd497848a0fd763185e79b0361da1dbb (diff)
parente675fe4621bc5668d5d9b72961a38be72baf23dd (diff)
Merge branch 'sh-validate-ref-name-in-commit' into 'master'
Validate refs used in controllers don't have spaces Closes #58572 and gitaly#1425 See merge request gitlab-org/gitlab-ce!24037
Diffstat (limited to 'lib')
-rw-r--r--lib/extracts_path.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index b2c8d46ede1..44a9c7ea536 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -113,6 +113,9 @@ module ExtractsPath
@id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
+ @ref.strip!
+
+ raise InvalidPathError if @ref.match?(/\s/)
@commit = @repo.commit(@ref)