aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Nikolov <ggeorgi60@gmail.com>2025-01-26 15:34:16 +0200
committerGeorgi Nikolov <ggeorgi60@gmail.com>2025-01-26 15:34:16 +0200
commit304546c7c6014a20aef5fb9af6081132693eff7d (patch)
tree6e6050801970a2a785c9d7fd2bd1c5ad302a1256
parent5ee3df4d830ead2f19d0150619a06ce5ac841b7b (diff)
downloadnowayforward_human-304546c7c6014a20aef5fb9af6081132693eff7d.tar
nowayforward_human-304546c7c6014a20aef5fb9af6081132693eff7d.tar.gz
nowayforward_human-304546c7c6014a20aef5fb9af6081132693eff7d.zip
Fixed the inside pages' css urls not being downloaded correctly
-rw-r--r--controllers/archive.php14
1 files changed, 10 insertions, 4 deletions
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 "<script>console.log('Debug Objects: " . $output . "' );</script>";
+ }
+
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