Import a safer fix from banana.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 19 Mar 2008 16:45:30 +0000 (17:45 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 19 Mar 2008 16:45:30 +0000 (17:45 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plupload.php

index 1911ab9..7184bbd 100644 (file)
@@ -67,7 +67,7 @@ class PlUpload
         if ($this->exists()) {
             $this->type = trim(mime_content_type($this->filename));
             if ($this->type == 'text/plain') { // Workaround a bug of php 5.2.0+etch10 (mime_content_type fallback is 'text/plain')
-                $this->type = trim(exec("file -bi " . escapeshellarg($this->filename)));
+                $this->type = preg_replace('/;.*/', '', trim(shell_exec('file -bi ' . escapeshellarg($this->filename))));
             }
         }
     }