Fixed compression script, Improved HTTP header lang parsing

Update langs.php and compress.bat
This commit is contained in:
2024-01-08 22:52:45 +01:00
parent a3f8d51949
commit 1d31ac1a23
2 changed files with 7 additions and 1 deletions

View File

@@ -25,7 +25,12 @@ function process_lang_header(string $accepted_lang_header, bool $filter_unsuppor
foreach(explode(",", $accepted_lang_header) as $_client_lang_entry) { foreach(explode(",", $accepted_lang_header) as $_client_lang_entry) {
$lang_entry_parts = explode(";", $_client_lang_entry); $lang_entry_parts = explode(";", $_client_lang_entry);
// Ignoring entries without a "q=<float>" part // Modifying entries without a "q=<float>" 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) { if(count($lang_entry_parts) != 2) {
continue; continue;
} }

View File

@@ -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/*.*"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "content/items/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "content/items/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "contributors/" 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% "links/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "privacy/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "privacy/"
set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/FontAwesomePro/5.15.3/" set NP_ZIP_CONTENT=%NP_ZIP_CONTENT% "resources/FontAwesomePro/5.15.3/"