summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-07-22 19:10:42 +0200
committerAleksander Machniak <alec@alec.pl>2014-07-22 19:12:04 +0200
commit9cf50d16d40a829a09d8275cb6895c2dcd9b959d (patch)
tree5c7486c2ca43b856e6d46c0abcecd1fd921d2a85
parentae502b364d08e3bd2001b22caa14f18962a738d6 (diff)
Fix some mime-type to extension mapping checks in Installer (#1489983)
Conflicts: CHANGELOG
-rw-r--r--CHANGELOG2
-rw-r--r--installer/rcube_install.php4
-rw-r--r--installer/test.php7
3 files changed, 6 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 12a91c656..6888b015d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix some mime-type to extension mapping checks in Installer (#1489983)
+
RELEASE 1.0.2
-------------
- Fix storing unsaved drafts in localStorage (#1489818)
diff --git a/installer/rcube_install.php b/installer/rcube_install.php
index ef7000688..85688d171 100644
--- a/installer/rcube_install.php
+++ b/installer/rcube_install.php
@@ -490,7 +490,7 @@ class rcube_install
$types = array(
'application/zip' => 'zip',
'application/x-tar' => 'tar',
- 'application/java-archive' => 'jar',
+ 'application/pdf' => 'pdf',
'image/gif' => 'gif',
'image/svg+xml' => 'svg',
);
@@ -498,7 +498,7 @@ class rcube_install
$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);
}
}
diff --git a/installer/test.php b/installer/test.php
index 5d5968e69..5e7cd8c71 100644
--- a/installer/test.php
+++ b/installer/test.php
@@ -210,7 +210,6 @@ if ($db_working) {
<h3>Test filetype detection</h3>
-<p>
<?php
if ($errors = $RCI->check_mime_detection()) {
@@ -225,12 +224,9 @@ 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');
@@ -239,6 +235,7 @@ if ($errors = $RCI->check_mime_extensions()) {
}
else {
$RCI->pass('Mimetype to file extension mapping');
+ echo "<br/>";
}
?>