Aleksander Machniak
2014-07-22 9cf50d16d40a829a09d8275cb6895c2dcd9b959d
Fix some mime-type to extension mapping checks in Installer (#1489983)

Conflicts:

CHANGELOG
3 files modified
13 ■■■■ changed files
CHANGELOG 2 ●●●●● patch | view | raw | blame | history
installer/rcube_install.php 4 ●●●● patch | view | raw | blame | history
installer/test.php 7 ●●●● patch | view | raw | blame | history
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)
installer/rcube_install.php
@@ -490,7 +490,7 @@
    $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 @@
    $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);
      }
    }
installer/test.php
@@ -210,7 +210,6 @@
<h3>Test filetype detection</h3>
<p>
<?php
if ($errors = $RCI->check_mime_detection()) {
@@ -225,12 +224,9 @@
}
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 @@
}
else {
  $RCI->pass('Mimetype to file extension mapping');
  echo "<br/>";
}
?>