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
1 changed files with 7 additions and 1 deletions

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)
if link && !link.empty?
templated "confirm_leave" templated "confirm_leave"
else
env.redirect "#{referer}"
end
end end
end end