Commit a699a65c authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'sh-ignore-arrays-url-sanitizer' into 'master'

Only allow strings in URL::Sanitizer.valid?

Closes #55079

See merge request gitlab-org/gitlab-ce!23675
---
title: Only allow strings in URL::Sanitizer.valid?
merge_request: 23675
author:
type: fixed
......@@ -14,6 +14,7 @@ def self.sanitize(content)
def self.valid?(url)
return false unless url.present?
return false unless url.is_a?(String)
uri = Addressable::URI.parse(url.strip)
......
......@@ -41,6 +41,7 @@ def sanitize_url(url)
false | '123://invalid:url'
false | 'valid@project:url.git'
false | 'valid:pass@project:url.git'
false | %w(test array)
true | 'ssh://example.com'
true | 'ssh://:@example.com'
true | 'ssh://foo@example.com'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment