From 061abb88b568c4cdc35266fb8c32d1bfabcb8c8f Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 5 Jun 2012 11:50:21 +0200 Subject: [PATCH] write a warning to the log file if .htaccess is not writable instead of failing silently --- lib/files.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/files.php b/lib/files.php index 885f6977fb..705b7a6ca6 100644 --- a/lib/files.php +++ b/lib/files.php @@ -373,10 +373,12 @@ class OC_Files { } } - //supress errors in case we don't have permissions for it - if(@file_put_contents(OC::$SERVERROOT.'/.htaccess', $htaccess)) { - return OC_Helper::computerFileSize($size); - } + //check for write permissions + if(is_writable(OC::$SERVERROOT.'/.htaccess')) { + file_put_contents(OC::$SERVERROOT.'/.htaccess', $htaccess); + return OC_Helper::computerFileSize($size); + } else { OC_Log::write('files','Can\'t write upload limit to '.OC::$SERVERROOT.'/.htaccess. Please check the file permissions',OC_Log::WARN); } + return false; }