Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4856' into develop
Browse files Browse the repository at this point in the history
Forward port #4856
  • Loading branch information
weierophinney committed Jul 19, 2013
2 parents d9bfca4 + 8f9bb09 commit a0bf7a7
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions library/Zend/Validator/File/MimeType.php
Expand Up @@ -101,31 +101,31 @@ public function __construct($options = null)
} elseif (is_string($options)) {
$this->setMimeType($options);
$options = array();
}

if (isset($options['magicFile'])) {
$this->setMagicFile($options['magicFile']);
unset($options['magicFile']);
}
} elseif (is_array($options)) {
if (isset($options['magicFile'])) {
$this->setMagicFile($options['magicFile']);
unset($options['magicFile']);
}

if (isset($options['enableHeaderCheck'])) {
$this->enableHeaderCheck($options['enableHeaderCheck']);
unset($options['enableHeaderCheck']);
}
if (isset($options['enableHeaderCheck'])) {
$this->enableHeaderCheck($options['enableHeaderCheck']);
unset($options['enableHeaderCheck']);
}

if (array_key_exists('mimeType', $options)) {
$this->setMimeType($options['mimeType']);
unset($options['mimeType']);
}
if (array_key_exists('mimeType', $options)) {
$this->setMimeType($options['mimeType']);
unset($options['mimeType']);
}

// Handle cases where mimetypes are interspersed with options, or
// options are simply an array of mime types
foreach (array_keys($options) as $key) {
if (!is_int($key)) {
continue;
// Handle cases where mimetypes are interspersed with options, or
// options are simply an array of mime types
foreach (array_keys($options) as $key) {
if (!is_int($key)) {
continue;
}
$this->addMimeType($options[$key]);
unset($options[$key]);
}
$this->addMimeType($options[$key]);
unset($options[$key]);
}

parent::__construct($options);
Expand Down

0 comments on commit a0bf7a7

Please sign in to comment.