From 2cf829090fe4d636de7216ccd7a772b56c154897 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Mon, 8 Jul 2024 09:51:29 +0200 Subject: [PATCH] fix host method error fixes the error: Can't locate object method "host" via package "URI::_foreign" at /omd/sites/Prom1/share/thruk/lib/Thruk/Utils/Filter.pm line 1728 --- lib/Thruk/Utils/Filter.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Thruk/Utils/Filter.pm b/lib/Thruk/Utils/Filter.pm index 56b1e1318..b1057f605 100644 --- a/lib/Thruk/Utils/Filter.pm +++ b/lib/Thruk/Utils/Filter.pm @@ -1723,6 +1723,11 @@ sub _is_frame_url_allowed { $url = URI->new($url); my $req = $c->req->uri; + # unknown links cannot be embedded + return unless $url; + return unless $url->can("scheme"); + return unless $url->can("host"); + # relative links are allowed return 1 unless $url->scheme; return 1 unless $url->host;