Thomas Bruederli
2012-11-17 8fb4f05725b90bee03aaf284adb21818789a15c0
Move default value for client_mimetypes to rcube_config; make sure an array is returned
2 files modified
12 ■■■■ changed files
program/include/rcube_config.php 9 ●●●● patch | view | raw | blame | history
program/steps/mail/show.inc 3 ●●●● patch | view | raw | blame | history
program/include/rcube_config.php
@@ -207,8 +207,15 @@
        $rcube = rcube::get_instance();
        if ($name == 'timezone' && isset($this->prop['_timezone_value']))
        if ($name == 'timezone' && isset($this->prop['_timezone_value'])) {
            $result = $this->prop['_timezone_value'];
        }
        else if ($name == 'client_mimetypes') {
            if ($result == null && $def == null)
                $result = 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,image/bmp,image/tiff,application/x-javascript,application/pdf,application/x-shockwave-flash';
            if ($result && is_string($result))
                $result = explode(',', $result);
        }
        $plugin = $rcube->plugins->exec_hook('config_get', array(
            'name' => $name, 'default' => $def, 'result' => $result));
program/steps/mail/show.inc
@@ -62,8 +62,7 @@
  $OUTPUT->set_env('compose_extwin', $RCMAIL->config->get('compose_extwin',false));
  // mimetypes supported by the browser (default settings)
  $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,image/bmp,image/tiff,application/x-javascript,application/pdf,application/x-shockwave-flash');
  $mimetypes = is_string($mimetypes) ? explode(',', $mimetypes) : (array)$mimetypes;
  $mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
  // Remove unsupported types, which makes that attachment which cannot be
  // displayed in a browser will be downloaded directly without displaying an overlay page