Commit 441a9bee authored by Leandro Camargo's avatar Leandro Camargo

Make some other refinements to validation logic

parent 8fe708f4
...@@ -66,7 +66,8 @@ module Gitlab ...@@ -66,7 +66,8 @@ module Gitlab
private private
def look_like_regexp?(value) def look_like_regexp?(value)
value.start_with?('/') && value.end_with?('/') value.is_a?(String) && value.start_with?('/') &&
value.end_with?('/')
end end
def validate_regexp(value) def validate_regexp(value)
...@@ -92,7 +93,6 @@ module Gitlab ...@@ -92,7 +93,6 @@ module Gitlab
end end
def validate_string_or_regexp(value) def validate_string_or_regexp(value)
return true if value.is_a?(Symbol)
return false unless value.is_a?(String) return false unless value.is_a?(String)
return validate_regexp(value) if look_like_regexp?(value) return validate_regexp(value) if look_like_regexp?(value)
true true
......
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