mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-09 15:02:14 +05:30
refactor: add better link presence checking
This commit is contained in:
parent
be1ed83930
commit
307e6f5686
@ -46,17 +46,14 @@ module Invidious::Routes::Misc
|
|||||||
|
|
||||||
def self.confirm_leave(env)
|
def self.confirm_leave(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
locale = env.get("preferences").as(Preferences).locale
|
||||||
|
|
||||||
link = env.params.query["link"]?
|
|
||||||
link = HTML.escape(link.to_s)
|
|
||||||
|
|
||||||
referer = get_referer(env)
|
referer = get_referer(env)
|
||||||
|
|
||||||
if link && !link.empty?
|
if env.params.query["link"]? && !env.params.query["link"].empty?
|
||||||
|
link = HTML.escape(env.params.query["link"].to_s)
|
||||||
|
|
||||||
templated "confirm_leave"
|
templated "confirm_leave"
|
||||||
else
|
else
|
||||||
env.redirect "#{referer}"
|
env.redirect "#{referer}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user