src build elFinder-2.1-a544082

This commit is contained in:
nao-pon
2015-11-22 20:55:48 +09:00
parent 5a71af3abf
commit d36ea13bcf
5 changed files with 9 additions and 11 deletions
+3 -5
View File
@@ -1762,7 +1762,8 @@ abstract class elFinderVolumeDriver {
// check MIME
$name = $this->basenameCE($path);
$mime = '';
if ($this->mimeDetect != 'internal') {
$mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name);
if ($this->mimeDetect !== 'internal') {
if ($tp = tmpfile()) {
fwrite($tp, $content);
$info = stream_get_meta_data($tp);
@@ -1771,10 +1772,7 @@ abstract class elFinderVolumeDriver {
fclose($tp);
}
}
if (!$mime) {
$mime = $this->mimetype($name);
}
if (!$this->allowPutMime($mime)) {
if (!$this->allowPutMime($mimeByName) || ($mime && $mime !== 'unknown' && !$this->allowPutMime($mime))) {
return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME);
}