From 16f376bca1e35cc39c12456fd3946cf7293492fc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2011 22:55:27 +0200 Subject: [PATCH] escape filenames for getMimeType --- lib/filestorage/local.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index f0961c17509..d1fe87ec4c2 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -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);