Skip to content

Commit

Permalink
Merge branch '2.x' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Nov 11, 2015
2 parents 50f4652 + 48d0f61 commit afabbb2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,11 @@ public function rename($hash, $name) {
return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
}

$mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name);
if ($mimeByName && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName)) {
return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
}

if (!($file = $this->file($hash))) {
return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
}
Expand Down Expand Up @@ -1556,7 +1561,7 @@ public function upload($fp, $dst, $name, $tmpname) {
}
}

if (!$this->allowPutMime($mime) || ($mimeByName && !$this->allowPutMime($mimeByName))) {
if (!$this->allowPutMime($mime) || ($mimeByName && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName))) {
return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME);
}

Expand Down

0 comments on commit afabbb2

Please sign in to comment.