Skip to content

Commit 95b0e60

Browse files
Fix #19683: Updated framework\mimeType.php to the actual value. Fix typo in build/controllers/MimeTypeController.php
1 parent 5d0d6f4 commit 95b0e60

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

build/controllers/MimeTypeController.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ private function generateMimeTypesFile($outFile, $content)
101101
ksort($mimeMap);
102102
$array = VarDumper::export($mimeMap);
103103

104-
if (PHP_VERSION_ID >= 80100) {
105-
$array = array_replace($array, array('xz' => 'application/octet-stream'));
106-
}
107-
108104
$content = <<<EOD
109105
<?php
110106
/**
@@ -116,8 +112,13 @@ private function generateMimeTypesFile($outFile, $content)
116112
* https://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup
117113
* This file has been placed in the public domain for unlimited redistribution.
118114
*/
119-
return $array;
115+
\$mimeTypes = $array;
116+
117+
if (PHP_VERSION_ID >= 80100) {
118+
\$mimeTypes = array_replace(\$mimeTypes, array('xz' => 'application/octet-stream'));
119+
}
120120
121+
return \$mimeTypes;
121122
EOD;
122123
file_put_contents($outFile, $content);
123124
$this->stdout("done.\n", Console::FG_GREEN);

framework/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
44
2.0.48 under development
55
------------------------
66

7+
- Bug #19683: Updated `framework\mimeType.php` to the actual value. Fix typo in `build/controllers/MimeTypeController.php` (DeryabinSergey)
78
- Bug #19705: Add binary and other data type to `$typeMap` list for MySQL (sohelahmed7)
89
- Enh #19741: Added option to use a closure for `$variations` definition in `yii\filters\PageCache` (nadar)
910
- Bug #15376: Added $userId for RBAC roles cache (manchenkoff)

framework/helpers/mimeTypes.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,12 @@
318318
'htke' => 'application/vnd.kenameaapp',
319319
'htm' => 'text/html',
320320
'html' => 'text/html',
321-
'hvd' => 'application/vnd.yamaha.hv-dic',
322321
'hvp' => 'application/vnd.yamaha.hv-voice',
323322
'hvs' => 'application/vnd.yamaha.hv-script',
324323
'i2g' => 'application/vnd.intergeo',
325324
'icc' => 'application/vnd.iccprofile',
325+
0 => 'application/vnd.lotus-1-2-3',
326+
'hvd' => 'application/vnd.yamaha.hv-dic',
326327
'ice' => 'x-conference/x-cooltalk',
327328
'icm' => 'application/vnd.iccprofile',
328329
'ico' => 'image/x-icon',
@@ -355,7 +356,6 @@
355356
'jam' => 'application/vnd.jam',
356357
'jar' => 'application/java-archive',
357358
'java' => 'text/x-java-source',
358-
'jfif' => 'image/jpeg',
359359
'jisp' => 'application/vnd.jisp',
360360
'jlt' => 'application/vnd.hp-jlyt',
361361
'jnlp' => 'application/x-java-jnlp-file',
@@ -366,7 +366,7 @@
366366
'jpgm' => 'video/jpm',
367367
'jpgv' => 'video/jpeg',
368368
'jpm' => 'video/jpm',
369-
'js' => 'application/javascript',
369+
'js' => 'text/javascript',
370370
'json' => 'application/json',
371371
'jsonml' => 'application/jsonml+json',
372372
'kar' => 'audio/midi',
@@ -401,7 +401,6 @@
401401
'log' => 'text/plain',
402402
'lostxml' => 'application/lost+xml',
403403
'lrf' => 'application/octet-stream',
404-
0 => 'application/vnd.lotus-1-2-3',
405404
'lrm' => 'application/vnd.ms-lrm',
406405
'ltf' => 'application/vnd.frogans.ltf',
407406
'lvp' => 'audio/vnd.lucent.voice',
@@ -1001,4 +1000,4 @@
10011000
$mimeTypes = array_replace($mimeTypes, array('xz' => 'application/octet-stream'));
10021001
}
10031002

1004-
return $mimeTypes;
1003+
return $mimeTypes;

tests/framework/helpers/MimeTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,12 @@ public function testMimeTypes()
348348
'htke' => 'application/vnd.kenameaapp',
349349
'htm' => 'text/html',
350350
'html' => 'text/html',
351-
'hvd' => 'application/vnd.yamaha.hv-dic',
352351
'hvp' => 'application/vnd.yamaha.hv-voice',
353352
'hvs' => 'application/vnd.yamaha.hv-script',
354353
'i2g' => 'application/vnd.intergeo',
355354
'icc' => 'application/vnd.iccprofile',
355+
0 => 'application/vnd.lotus-1-2-3',
356+
'hvd' => 'application/vnd.yamaha.hv-dic',
356357
'ice' => 'x-conference/x-cooltalk',
357358
'icm' => 'application/vnd.iccprofile',
358359
'ico' => 'image/x-icon',
@@ -385,7 +386,6 @@ public function testMimeTypes()
385386
'jam' => 'application/vnd.jam',
386387
'jar' => 'application/java-archive',
387388
'java' => 'text/x-java-source',
388-
'jfif' => 'image/jpeg',
389389
'jisp' => 'application/vnd.jisp',
390390
'jlt' => 'application/vnd.hp-jlyt',
391391
'jnlp' => 'application/x-java-jnlp-file',
@@ -396,7 +396,7 @@ public function testMimeTypes()
396396
'jpgm' => 'video/jpm',
397397
'jpgv' => 'video/jpeg',
398398
'jpm' => 'video/jpm',
399-
'js' => 'application/javascript',
399+
'js' => 'text/javascript',
400400
'json' => 'application/json',
401401
'jsonml' => 'application/jsonml+json',
402402
'kar' => 'audio/midi',
@@ -431,7 +431,6 @@ public function testMimeTypes()
431431
'log' => 'text/plain',
432432
'lostxml' => 'application/lost+xml',
433433
'lrf' => 'application/octet-stream',
434-
0 => 'application/vnd.lotus-1-2-3',
435434
'lrm' => 'application/vnd.ms-lrm',
436435
'ltf' => 'application/vnd.frogans.ltf',
437436
'lvp' => 'audio/vnd.lucent.voice',

0 commit comments

Comments
 (0)