diff --git a/classes/MarketImage.class.php b/classes/MarketImage.class.php index 1e87af1759096a0db04c325b0d6fefce206fa01b..7fb8eae85c81b6725959b37d41bb5159fdcb1df8 100644 --- a/classes/MarketImage.class.php +++ b/classes/MarketImage.class.php @@ -45,7 +45,7 @@ class MarketImage extends SimpleORMap { public function outputImage() { $path = self::getImageDataPath() . "/" . $this->getId(); - header("Content-Type: " . mime_content_type($path)); + header("Content-Type: " . $this['mimetype']); header("Content-Disposition: inline; filename=" . $this['filename']); echo file_get_contents($path); } diff --git a/controllers/myplugins.php b/controllers/myplugins.php index d47da972e70045debbcd6e8f5a6662a4a2a1a14f..18b3958089aa9c4db4694e586c906c6606b6ff64 100644 --- a/controllers/myplugins.php +++ b/controllers/myplugins.php @@ -112,7 +112,7 @@ class MypluginsController extends PluginController { $file = new MarketImage(); $file['plugin_id'] = $this->marketplugin->getId(); $file['filename'] = $name; - $file['mimetype'] = $files['type'][$index]; + $file['mimetype'] = mime_content_type($files['tmp_name'][$index]); $file['position'] = $position; $file->installFromPath($files['tmp_name'][$index]); $file->store(); diff --git a/controllers/presenting.php b/controllers/presenting.php index a79da242c98f1a5e86f3feb0237208c9e34459a7..7b113e34010cb285b77ab9741e242f5f9341c3ca 100644 --- a/controllers/presenting.php +++ b/controllers/presenting.php @@ -155,7 +155,10 @@ class PresentingController extends PluginController { public function image_action($image_id) { $this->image = new MarketImage($image_id); + + $this->set_content_type($this->image['mimetype']); $this->image->outputImage(); + $this->render_nothing(); }