summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-02-03 16:41:17 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-02-03 16:43:03 +0100
commitdda80c29ed4177720c2117c46c1bd134ec61f812 (patch)
treeed3779471b04073a5d73887fb5f71010ba721bb8 /application
parent0fdfe6ad2cf73ddf52dcc67efd9805dede90a2dd (diff)
Use php's fileinfo instead of perl to detect mimetype
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r--application/models/mfile.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/application/models/mfile.php b/application/models/mfile.php
index 99e630efe..ec1b8b586 100644
--- a/application/models/mfile.php
+++ b/application/models/mfile.php
@@ -84,7 +84,9 @@ class Mfile extends CI_Model {
{
$userid = $this->muser->get_userid();
- $mimetype = exec("perl ".FCPATH.'scripts/mimetype '.escapeshellarg($filename).' '.escapeshellarg($this->file($hash)));
+ $fileinfo = new finfo(FILEINFO_MIME_TYPE);
+ $mimetype = $fileinfo->file($this->file($hash));
+
$filesize = filesize($this->file($hash));
$query = $this->db->query('
INSERT INTO `files` (`hash`, `id`, `filename`, `user`, `date`, `mimetype`, `filesize`)