From d6d08a78344675340fe5cffbeaab16550b37eceb Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 11 Aug 2011 16:13:05 +0200 Subject: rewrite scripts/mimetype to support ascii with color codes Signed-off-by: Florian Pritz --- application/models/file_mod.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'application') diff --git a/application/models/file_mod.php b/application/models/file_mod.php index 15bab0c4d..dcf33f9d4 100644 --- a/application/models/file_mod.php +++ b/application/models/file_mod.php @@ -96,7 +96,7 @@ class File_mod extends CI_Model { // TODO: Should only update not insert; see new_id() function add_file($hash, $id, $filename) { - $mimetype = exec(FCPATH.'scripts/mimetype -b --orig-name '.escapeshellarg($filename).' '.escapeshellarg($this->file($hash))); + $mimetype = exec(FCPATH.'scripts/mimetype '.escapeshellarg($filename).' '.escapeshellarg($this->file($hash))); $query = $this->db->query(' INSERT INTO `files` (`hash`, `id`, `filename`, `password`, `date`, `mimetype`) VALUES (?, ?, ?, ?, ?, ?)', @@ -379,6 +379,7 @@ class File_mod extends CI_Model { { $typearray = array( 'text/plain' => 'text', + 'text/plain-ascii' => 'ascii', 'text/x-python' => 'python', 'text/x-csrc' => 'c', 'text/x-chdr' => 'c', -- cgit v1.2.3-24-g4f1b