From 304546c7c6014a20aef5fb9af6081132693eff7d Mon Sep 17 00:00:00 2001 From: Georgi Nikolov Date: Sun, 26 Jan 2025 15:34:16 +0200 Subject: Fixed the inside pages' css urls not being downloaded correctly --- controllers/archive.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'controllers') diff --git a/controllers/archive.php b/controllers/archive.php index e730719..6beb826 100644 --- a/controllers/archive.php +++ b/controllers/archive.php @@ -40,6 +40,15 @@ class DownloadPage { } } + + private function debugPrintToConsole($data) : void{ + $output = $data; + if (is_array($output)) + $output = implode(',', $output); + + echo ""; + } + function tryDownloadFavicon() : void { // Tries to download an icon from the server directly // The tried names are favicon.png/ico/jpeg/jpg/svg @@ -158,10 +167,7 @@ class DownloadPage { $url = rtrim($url, "'()"); $url = substr($url, 0, strpos($url, "'")); - // Handle relative URLs - if (parse_url($url, PHP_URL_SCHEME) === null) { - $url = $this->page_url . $url; - } + $url = $this->resolveUrl($url, $this->page_url); if ($this->isResourceAccessible($url)) { // Get the file name and local path -- cgit v1.2.3