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:10:42 +0200
commit6b0106a32446a125fd8a4ea7b9637c2378d52f72 (patch)
tree1fdb48496b0ced8f316b89023d09d48d7373e405
parentbe6a095f83bea9d21002186de4dfdb6e934ddc3e (diff)
Fix some mime-type to extension mapping checks in Installer (#1489983)
-rw-r--r--CHANGELOG1
-rw-r--r--installer/test.php7
-rw-r--r--program/include/rcmail_install.php4
3 files changed, 5 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b63c6f445..518281b52 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -37,6 +37,7 @@ CHANGELOG Roundcube Webmail
- 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
-------------
diff --git a/installer/test.php b/installer/test.php
index b1b67e57d..72c7a1f76 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/>";
}
?>
diff --git a/program/include/rcmail_install.php b/program/include/rcmail_install.php
index eec21ec7e..9945f1d81 100644
--- a/program/include/rcmail_install.php
+++ b/program/include/rcmail_install.php
@@ -476,7 +476,7 @@ class rcmail_install
$types = array(
'application/zip' => 'zip',
'application/x-tar' => 'tar',
- 'application/java-archive' => 'jar',
+ 'application/pdf' => 'pdf',
'image/gif' => 'gif',
'image/svg+xml' => 'svg',
);
@@ -484,7 +484,7 @@ class rcmail_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);
}
}