Fixed escaping of filename when determining MIME type

This commit is contained in:
Jernej Virag 2012-04-25 10:33:52 +02:00
parent 20f1c1e6ca
commit e459309511
1 changed files with 2 additions and 2 deletions

View File

@ -341,8 +341,8 @@ class OC_Helper {
if (!$isWrapped and $mimeType=='application/octet-stream' && OC_Helper::canExecute("file")) {
// it looks like we have a 'file' command,
// lets see it it does have mime support
$path=str_replace("'","\'",$path);
$fp = popen("file -i -b '$path' 2>/dev/null", "r");
$path=escapeshellarg($path);
$fp = popen("file -i -b $path 2>/dev/null", "r");
$reply = fgets($fp);
pclose($fp);