Skip to content

Commit

Permalink
Merge pull request #20000 from yiisoft/fix-mime-type-generator
Browse files Browse the repository at this point in the history
Fix mime type generator
  • Loading branch information
bizley authored Oct 12, 2023
2 parents bd296eb + 0726714 commit 11d4b2c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build/controllers/MimeTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ 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;
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'));
}
Expand All @@ -148,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;
Expand Down Expand Up @@ -209,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;
Expand Down

0 comments on commit 11d4b2c

Please sign in to comment.