feat: add presence checking and html escaping for link

This commit is contained in:
unlxam 2024-08-24 13:40:28 -03:00
parent 42ac3c8a21
commit be1ed83930

View File

@ -48,9 +48,15 @@ module Invidious::Routes::Misc
locale = env.get("preferences").as(Preferences).locale locale = env.get("preferences").as(Preferences).locale
link = env.params.query["link"]? link = env.params.query["link"]?
link = HTML.escape(link.to_s)
referer = get_referer(env) referer = get_referer(env)
templated "confirm_leave" if link && !link.empty?
templated "confirm_leave"
else
env.redirect "#{referer}"
end
end end
end end