diff --git a/app/models/web_link.rb b/app/models/web_link.rb index 3853ccb..4211e6a 100644 --- a/app/models/web_link.rb +++ b/app/models/web_link.rb @@ -32,9 +32,10 @@ class WebLink temp_url = {} Site.first.in_use_locales.each do |locale| locale = locale.to_s - temp_url[locale] = self.url_translations[locale] - unless /https?:\/\/[\S]+/.match(self.url_translations[locale]) || self.url_translations[locale].blank? - temp_url[locale] = 'http://' + self.url_translations[locale] + tmp = self.url_translations[locale] + temp_url[locale] = tmp + unless tmp.match(/^http(s|):\/\//) || tmp.blank? || tmp.start_with?('/') + temp_url[locale] = 'http://' + tmp end end self.url_translations = temp_url