From 1d31ac1a23ed06f94b58a67e929d86843411f06f Mon Sep 17 00:00:00 2001 From: Herwin Date: Mon, 8 Jan 2024 22:52:45 +0100 Subject: [PATCH] Fixed compression script, Improved HTTP header lang parsing Update langs.php and compress.bat --- commons/langs.php | 7 ++++++- compress.bat | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/commons/langs.php b/commons/langs.php index 2cac543..eddf56c 100644 --- a/commons/langs.php +++ b/commons/langs.php @@ -25,7 +25,12 @@ function process_lang_header(string $accepted_lang_header, bool $filter_unsuppor foreach(explode(",", $accepted_lang_header) as $_client_lang_entry) { $lang_entry_parts = explode(";", $_client_lang_entry); - // Ignoring entries without a "q=" part + // Modifying entries without a "q=" part to have a '0.1' value + if(count($lang_entry_parts) == 1) { + $lang_entry_parts = [$lang_entry_parts[0], "0.1"]; + } + + // Ignoring unexpected entries if(count($lang_entry_parts) != 2) { continue; } diff --git a/compress.bat b/compress.bat index 398081c..11908de 100644 --- a/compress.bat +++ b/compress.bat @@ -30,6 +30,7 @@ set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "contact/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "content/*.*" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "content/items/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "contributors/" +set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "debug/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "links/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "privacy/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/FontAwesomePro/5.15.3/"