summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
Diffstat (limited to 'application/models')
-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`)