This commit is contained in:
BoHung Chiu 2022-11-19 10:38:49 +08:00
parent 8ef1464c4b
commit 3b1b672cfe
1 changed files with 4 additions and 3 deletions

View File

@ -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