From 0a0709674b275364c5f9aa8f37114ad941b99fbf Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Wed, 2 Mar 2022 16:39:12 +0100 Subject: [PATCH] attempt to handle one error --- retriever/retriever.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retriever/retriever.php b/retriever/retriever.php index cd8aacea4..263f58426 100644 --- a/retriever/retriever.php +++ b/retriever/retriever.php @@ -639,6 +639,9 @@ function retriever_extract($doc, $retriever) { */ function retriever_globalise_urls($doc, $resource) { $components = parse_url($resource['redirect-url']); + if (!array_key_exists('scheme', $components) || !array_key_exists('host', $components) || !array_key_exists('path', $components)) { + return $doc; + } $rooturl = $components['scheme'] . "://" . $components['host']; $dirurl = $rooturl . dirname($components['path']) . "/"; $params = array('$dirurl' => $dirurl, '$rooturl' => $rooturl);