Fix some mime-type to extension mapping checks in Installer (#1489983)
| | |
| | | - Improve text messages display and conversion to HTML (#1488937) |
| | | - Don't remove links when html signature is converted to text (#1489621) |
| | | - Fix mbox files import |
| | | - Fix some mime-type to extension mapping checks in Installer (#1489983) |
| | | |
| | | RELEASE 1.0.2 |
| | | ------------- |
| | |
| | | |
| | | <h3>Test filetype detection</h3> |
| | | |
| | | <p> |
| | | <?php |
| | | |
| | | if ($errors = $RCI->check_mime_detection()) { |
| | |
| | | } |
| | | else { |
| | | $RCI->pass('Fileinfo/mime_content_type configuration'); |
| | | echo "<br/>"; |
| | | } |
| | | |
| | | ?> |
| | | </p> |
| | | <p> |
| | | <?php |
| | | |
| | | if ($errors = $RCI->check_mime_extensions()) { |
| | | $RCI->fail('Mimetype to file extension mapping'); |
| | |
| | | } |
| | | else { |
| | | $RCI->pass('Mimetype to file extension mapping'); |
| | | echo "<br/>"; |
| | | } |
| | | |
| | | ?> |
| | |
| | | $types = array( |
| | | 'application/zip' => 'zip', |
| | | 'application/x-tar' => 'tar', |
| | | 'application/java-archive' => 'jar', |
| | | 'application/pdf' => 'pdf', |
| | | 'image/gif' => 'gif', |
| | | 'image/svg+xml' => 'svg', |
| | | ); |
| | |
| | | $errors = array(); |
| | | foreach ($types as $mimetype => $expected) { |
| | | $ext = rcube_mime::get_mime_extensions($mimetype); |
| | | if ($ext[0] != $expected) { |
| | | if (!in_array($expected, (array) $ext)) { |
| | | $errors[] = array($mimetype, $ext, $expected); |
| | | } |
| | | } |