aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Nikolov <ggeorgi60@gmail.com>2025-01-25 17:14:13 +0200
committerGeorgi Nikolov <ggeorgi60@gmail.com>2025-01-25 17:14:13 +0200
commit14a268ba7a7ec0127285f3cfdc253ce602da8170 (patch)
tree5fe9efde22d04068d92ca92e6e21c9c504f300b5
parente143770fc296e34862d95272fc79a56fa9d20a34 (diff)
downloadnowayforward_human-14a268ba7a7ec0127285f3cfdc253ce602da8170.tar
nowayforward_human-14a268ba7a7ec0127285f3cfdc253ce602da8170.tar.gz
nowayforward_human-14a268ba7a7ec0127285f3cfdc253ce602da8170.zip
Fixed an issue with the encoding of the html pages when donwloading them
-rw-r--r--controllers/archive_page.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/controllers/archive_page.php b/controllers/archive_page.php
index be73757..7372681 100644
--- a/controllers/archive_page.php
+++ b/controllers/archive_page.php
@@ -208,7 +208,8 @@ class DownloadPage {
function createArchive($simular_pages) : void {
// Creates the folder with the correct resources and the main html page in a index.html tag
$dom = new DOMDocument();
- @$dom->loadHTML($this->page_contents); // This suppresses warnings for invalid HTML
+ $contentType = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; // Ensures the encoding is UTF-8
+ @$dom->loadHTML($contentType . $this->page_contents); // This suppresses warnings for invalid HTML
$folder_path = $this->folder_location . '/' . $this->folder_name;
if (!file_exists($folder_path)) {