Merge pull request #10938 from owncloud/useSecureMimetype
Use secure mimetype for content delivery
This commit is contained in:
commit
2d847934ed
2 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ if(!\OC\Files\Filesystem::file_exists($filename)) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$ftype=\OC\Files\Filesystem::getMimeType( $filename );
|
||||
$ftype=\OC_Helper::getSecureMimeType(\OC\Files\Filesystem::getMimeType( $filename ));
|
||||
|
||||
header('Content-Type:'.$ftype);
|
||||
OCP\Response::setContentDispositionHeader(basename($filename), 'attachment');
|
||||
|
|
|
@ -49,7 +49,7 @@ class OC_Files {
|
|||
header('Content-Type: application/zip');
|
||||
} else {
|
||||
$filesize = \OC\Files\Filesystem::filesize($filename);
|
||||
header('Content-Type: '.\OC\Files\Filesystem::getMimeType($filename));
|
||||
header('Content-Type: '.\OC_Helper::getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)));
|
||||
if ($filesize > -1) {
|
||||
header("Content-Length: ".$filesize);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue