24b20c10ce
Fixes #354
11 lines
195 B
Ruby
11 lines
195 B
Ruby
require 'uri'
|
|
module UrlHelper
|
|
def url_valid?(url)
|
|
url = begin
|
|
URI.parse(url)
|
|
rescue StandardError
|
|
false
|
|
end
|
|
url.is_a?(URI::HTTP) || url.is_a?(URI::HTTPS)
|
|
end
|
|
end
|