]> source.dussan.org Git - nextcloud-server.git/commitdiff
Wrong permission checking on file save.
authorThomas Tanghus <thomas@tanghus.net>
Wed, 4 Jan 2012 22:31:32 +0000 (23:31 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Wed, 4 Jan 2012 22:31:32 +0000 (23:31 +0100)
lib/image.php

index 32568a25406eb0a5712c27815eb32d74b1232dcc..f120328b0e41795443852d0aa0cba1c057b4e224 100644 (file)
@@ -143,10 +143,10 @@ class OC_Image {
                        $filepath = null; // Just being cautious ;-)
                } else {
                        if(!is_writable(dirname($filepath))) {
-                               OC_Log::write('core','OC_Image::save. Directory \''.dirname($filepath).'\' is not writable.', OC_Log::ERROR);
+                               OC_Log::write('core','OC_Image::_output. Directory \''.dirname($filepath).'\' is not writable.', OC_Log::ERROR);
                                return false;
-                       } elseif(is_writable(dirname($filepath)) && !is_writable($filepath)) {
-                               OC_Log::write('core','OC_Image::save. File \''.$filepath.'\' is not writable.', OC_Log::ERROR);
+                       } elseif(is_writable(dirname($filepath)) && file_exists($filepath) && !is_writable($filepath)) {
+                               OC_Log::write('core','OC_Image::_output. File \''.$filepath.'\' is not writable.', OC_Log::ERROR);
                                return false;
                        }
                }