Aleksander Machniak
2013-01-15 b5b76d2ccb8e28183c078d242e1530508b2686ae
Make sure mimetypes is an array not object in a better way
2 files modified
4 ■■■■ changed files
program/js/app.js 2 ●●● patch | view | raw | blame | history
program/steps/mail/show.inc 2 ●●● patch | view | raw | blame | history
program/js/app.js
@@ -820,7 +820,7 @@
        var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part;
        // open attachment in frame if it's of a supported mimetype
        if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, $.map(this.env.mimetypes, function(v,k){ return v })) >= 0) {
        if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes) >= 0) {
          if (props.mimetype == 'text/html')
            qstring += '&_safe=1';
          this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment');
program/steps/mail/show.inc
@@ -79,7 +79,7 @@
    }
  }
  $OUTPUT->set_env('mimetypes', $mimetypes);
  $OUTPUT->set_env('mimetypes', array_values($mimetypes));
  if ($CONFIG['drafts_mbox'])
    $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);