escape filenames for getMimeType

This commit is contained in:
Robin Appelman 2011-10-20 22:55:27 +02:00
parent 7752008152
commit 16f376bca1

View file

@ -143,6 +143,7 @@ class OC_Filestorage_Local extends OC_Filestorage{
if ($mimeType=='application/octet-stream' && OC_Helper::canExecute("file")) {
// it looks like we have a 'file' command,
// lets see it it does have mime support
$fspath=str_replace("'","\'",$fspath);
$fp = popen("file -i -b '{$this->datadir}$fspath' 2>/dev/null", "r");
$reply = fgets($fp);
pclose($fp);