2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-20 18:52:44 +08:00

do not throw exception when parsing a bad URI

This commit is contained in:
Régis Hanol 2013-06-24 21:38:00 +02:00
parent c79ab3fc2e
commit da52ac88b0

View file

@ -181,6 +181,7 @@ class CookedPostProcessor
def is_valid_image_uri?(url)
uri = URI.parse(url)
%w(http https).include? uri.scheme
rescue URI::InvalidURIError
end
def dirty?