Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-01-05 02:31:32 +0400
committerThomas Tanghus <thomas@tanghus.net>2012-01-05 02:31:32 +0400
commitd80b477ab55c459cc80cf091c80f81082b7d78f9 (patch)
treee1bef7b6b6e100e3f2fb2c7f1d973be987aa517a /lib/image.php
parent48a8f2a793d2154c7f9d963fda679e0c380cb273 (diff)
Wrong permission checking on file save.
Diffstat (limited to 'lib/image.php')
-rw-r--r--lib/image.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/image.php b/lib/image.php
index 32568a25406..f120328b0e4 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -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;
}
}