From 9f51fe3b4b84a35e84f0bb5e9378d57eecbcbfae Mon Sep 17 00:00:00 2001 From: Robert Korulczyk Date: Fri, 6 Oct 2023 10:02:32 +0200 Subject: [PATCH] Revert changes in `mimeTypes.php` from 4a1f2c6b9bc90427e91da73f5e8c8fa33d3c53c1 restores https://github.com/yiisoft/yii2/pull/19936 --- framework/CHANGELOG.md | 3 +-- framework/helpers/mimeTypes.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 8c3d204757..35e8ebde9b 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -4,13 +4,12 @@ Yii Framework 2 Change Log 2.0.50 under development ------------------------ -- no changes in this release. +- Bug #19925: Improved PHP version check when handling MIME types (schmunk42) 2.0.49.1 October 05, 2023 ------------------------- -- Bug #19925: Improved PHP version check when handling MIME types (schmunk42) - Bug #19940: File Log writer without newline (terabytesoftw) - Bug #19950: Fix `Query::groupBy(null)` causes error for PHP 8.1: `trim(): Passing null to parameter #1 ($string) of type string is deprecated` (uaoleg) - Bug #19951: Removed unneeded MIME file tests (schmunk42) diff --git a/framework/helpers/mimeTypes.php b/framework/helpers/mimeTypes.php index 707bdc7717..e91f80f95f 100644 --- a/framework/helpers/mimeTypes.php +++ b/framework/helpers/mimeTypes.php @@ -1003,7 +1003,8 @@ $mimeTypes = [ 'zmm' => 'application/vnd.handheld-entertainment+xml', ]; -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')); }