From e45930951199935da2c979cb357cec67708e32eb Mon Sep 17 00:00:00 2001 From: Jernej Virag Date: Wed, 25 Apr 2012 10:33:52 +0200 Subject: Fixed escaping of filename when determining MIME type --- lib/helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/helper.php') diff --git a/lib/helper.php b/lib/helper.php index 82d1017debd..2ddd5e7b778 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -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); -- cgit v1.2.3