]> source.dussan.org Git - nextcloud-server.git/commitdiff
Content type header was sent when saving image to disk.
authorThomas Tanghus <thomas@tanghus.net>
Wed, 4 Jan 2012 21:56:58 +0000 (22:56 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Wed, 4 Jan 2012 21:57:42 +0000 (22:57 +0100)
lib/image.php

index e09486be0817e9b22105876f8d9ebe80d146b20a..32568a25406eb0a5712c27815eb32d74b1232dcc 100644 (file)
@@ -125,7 +125,7 @@ class OC_Image {
        */
 
        public function save($filepath=null) {
-               if($filepath === null && $this->filepath === null) {
+               if($filepath === null && self::$filepath === null) {
                        OC_Log::write('core','OC_Image::save. save() called with no path.', OC_Log::ERROR);
                        return false;
                } elseif($filepath === null && $this->filepath !== null) {
@@ -138,8 +138,8 @@ class OC_Image {
        * @brief Outputs/saves the image.
        */
        private function _output($filepath=null, $really=false) {
-               header('Content-Type: '.self::mimeType());
                if($really === false) {
+                       header('Content-Type: '.self::mimeType());
                        $filepath = null; // Just being cautious ;-)
                } else {
                        if(!is_writable(dirname($filepath))) {