diff options
author | Rémy Coutable <remy@rymai.me> | 2019-04-15 16:30:50 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-04-15 16:30:50 +0300 |
commit | b40ea0f1e2f2a7bb804b2181b87d74a75454f62b (patch) | |
tree | fc40d8bd471b7639fa2888afa9ef2ad4c1d0a321 /lib | |
parent | b15a78dfdd497848a0fd763185e79b0361da1dbb (diff) | |
parent | e675fe4621bc5668d5d9b72961a38be72baf23dd (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.rb | 3 |
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) |