diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 22:41:05 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 22:41:05 +0100 |
commit | 0fd5252cfc7c6d85d27bf1ec62fadbbc3267c0a1 (patch) | |
tree | 9a7241691cba692b74e0685baa3946698b569a7d /lib/image.php | |
parent | 169ddc5b0b14697088ca394eb07fa7c8473b1fcc (diff) | |
download | nextcloud-server-0fd5252cfc7c6d85d27bf1ec62fadbbc3267c0a1.tar.gz nextcloud-server-0fd5252cfc7c6d85d27bf1ec62fadbbc3267c0a1.zip |
OC_Image: Move Content-Type header to show function
Diffstat (limited to 'lib/image.php')
-rw-r--r-- | lib/image.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/image.php b/lib/image.php index 9081a3c7021..df8f76352a0 100644 --- a/lib/image.php +++ b/lib/image.php @@ -102,6 +102,7 @@ class OC_Image { * @returns bool */ public function show() { + header('Content-Type: '.$this->mimeType()); return $this->_output(); } @@ -117,17 +118,14 @@ class OC_Image { } elseif($filepath === null && $this->filepath !== null) { $filepath = $this->filepath; } - return $this->_output($filepath, true); + return $this->_output($filepath); } /** * @brief Outputs/saves the image. */ - private function _output($filepath=null, $really=false) { - if($really === false) { - header('Content-Type: '.$this->mimeType()); - $filepath = null; // Just being cautious ;-) - } else { + private function _output($filepath=null) { + if($filepath) { if(!is_writable(dirname($filepath))) { OC_Log::write('core',__METHOD__.'(): Directory \''.dirname($filepath).'\' is not writable.', OC_Log::ERROR); return false; |