Permalink
Browse files

MDL-32117 EQUELLA plugin: Remove warning when 'mimetypes' option is n…

…ot set
  • Loading branch information...
1 parent 205f169 commit a3fde71746da4fe0f7e5f6705a9ad53dcaa25777 nread committed with danpoltawski May 17, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 repository/equella/lib.php
View
@@ -18,7 +18,7 @@
class repository_equella extends repository {
/** @var array mimetype filter */
- private $mimetypes;
+ private $mimetypes = array();
/**
* Constructor
@@ -30,11 +30,11 @@ class repository_equella extends repository {
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
parent::__construct($repositoryid, $context, $options);
- if (!empty($this->options['mimetypes']) && !in_array('*', $this->options['mimetypes'])) {
- $this->mimetypes = $this->options['mimetypes'];
- $this->mimetypes = array_unique(array_map(array($this, 'toMimeType'), $this->options['mimetypes']));
- } else {
- $this->mimetypes = array();
+ if (isset($this->options['mimetypes'])) {
+ $mt = $this->options['mimetypes'];
+ if (!empty($mt) && !in_array('*', $mt)) {
+ $this->mimetypes = array_unique(array_map(array($this, 'toMimeType'), $mt));
+ }
}
}

0 comments on commit a3fde71

Please sign in to comment.