Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mime type generator #20000

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading