From 4addf02c262c203f482690288027b0be30cd679b Mon Sep 17 00:00:00 2001 From: Bizley Date: Sun, 8 Oct 2023 13:03:48 +0200 Subject: [PATCH 1/2] Fix mime type generator --- build/controllers/MimeTypeController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/controllers/MimeTypeController.php b/build/controllers/MimeTypeController.php index 9da23f67fcd..fd0275579ff 100644 --- a/build/controllers/MimeTypeController.php +++ b/build/controllers/MimeTypeController.php @@ -124,7 +124,8 @@ private function generateMimeTypesFile($outFile, $content) */ \$mimeTypes = $array; -if (PHP_VERSION_ID >= 80100) { +# fix for bundled libmagic bug, see also https://github.com/yiisoft/yii2/issues/19925 +if ((PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80122) || (PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80209)) { \$mimeTypes = array_replace(\$mimeTypes, array('xz' => 'application/octet-stream')); } From 0726714e55bee5d502233cd00cfee0e08b7463d6 Mon Sep 17 00:00:00 2001 From: Bizley Date: Sun, 8 Oct 2023 13:20:43 +0200 Subject: [PATCH 2/2] Added note --- build/controllers/MimeTypeController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/controllers/MimeTypeController.php b/build/controllers/MimeTypeController.php index fd0275579ff..7986dd56cc8 100644 --- a/build/controllers/MimeTypeController.php +++ b/build/controllers/MimeTypeController.php @@ -121,6 +121,9 @@ private function generateMimeTypesFile($outFile, $content) * Its content is generated from the apache http mime.types file. * https://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup * This file has been placed in the public domain for unlimited redistribution. + * + * All extra changes made to this file must be comitted to /build/controllers/MimeTypeController.php + * otherwise they will be lost on next build. */ \$mimeTypes = $array; @@ -149,6 +152,9 @@ private function generateMimeAliasesFile($outFile) * MIME aliases. * * This file contains aliases for MIME types. + * + * All extra changes made to this file must be comitted to /build/controllers/MimeTypeController.php + * otherwise they will be lost on next build. */ return $array; @@ -210,6 +216,9 @@ private function generateMimeExtensionsFile($outFile, $content) * Its content is generated from the apache http mime.types file. * https://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup * This file has been placed in the public domain for unlimited redistribution. + * + * All extra changes made to this file must be comitted to /build/controllers/MimeTypeController.php + * otherwise they will be lost on next build. */ return $array;