From 19ad5b5d35367ed47cef0c0ee00d82ea1c23b913 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 19 Mar 2008 17:45:30 +0100 Subject: [PATCH] Import a safer fix from banana. Signed-off-by: Florent Bruneau --- classes/plupload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/plupload.php b/classes/plupload.php index 1911ab9..7184bbd 100644 --- a/classes/plupload.php +++ b/classes/plupload.php @@ -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)))); } } } -- 2.1.4