We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b7afe6 commit b15dfebCopy full SHA for b15dfeb
1 file changed
app/controllers/thirdiron_controller.rb
@@ -26,14 +26,17 @@ def expected_params?
26
end
27
28
def safe_full_record_url(url)
29
+ return nil unless url.is_a?(String)
30
+
31
+ url = url.strip
32
return nil if url.blank?
33
34
parsed = URI.parse(url)
35
return nil unless parsed.is_a?(URI::HTTP) || parsed.is_a?(URI::HTTPS)
36
return nil if parsed.host.blank?
37
38
parsed.to_s
- rescue URI::InvalidURIError
39
+ rescue URI::InvalidURIError, ArgumentError
40
nil
41
42
0 commit comments