From dda80c29ed4177720c2117c46c1bd134ec61f812 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 3 Feb 2013 16:41:17 +0100 Subject: Use php's fileinfo instead of perl to detect mimetype Signed-off-by: Florian Pritz --- application/models/mfile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'application/models/mfile.php') 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`) -- cgit v1.2.3-24-g4f1b