aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorJernej Virag <jernej.virag@gmail.com>2012-04-25 10:33:52 +0200
committerJernej Virag <jernej.virag@gmail.com>2012-04-25 10:33:52 +0200
commite45930951199935da2c979cb357cec67708e32eb (patch)
tree2d3842a835f1d38539507dfa8756906f1ee61f12 /lib/helper.php
parent20f1c1e6ca40c09b67c404729a4bf986b4732051 (diff)
downloadnextcloud-server-e45930951199935da2c979cb357cec67708e32eb.tar.gz
nextcloud-server-e45930951199935da2c979cb357cec67708e32eb.zip
Fixed escaping of filename when determining MIME type
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php4
1 files changed, 2 insertions, 2 deletions
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);