attempt to handle one error

This commit is contained in:
Matthew Exon 2022-03-02 16:39:12 +01:00
parent a5241698c8
commit 194f987afd

View file

@ -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);