diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2012-06-05 11:50:21 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2012-06-05 11:50:21 +0200 |
commit | 061abb88b568c4cdc35266fb8c32d1bfabcb8c8f (patch) | |
tree | 65ae6d9382b5f0d1aff7254fa1a102711c7734d5 /lib/files.php | |
parent | d71c4db10aad0b1684087c745dcd10560351efb2 (diff) | |
download | nextcloud-server-061abb88b568c4cdc35266fb8c32d1bfabcb8c8f.tar.gz nextcloud-server-061abb88b568c4cdc35266fb8c32d1bfabcb8c8f.zip |
write a warning to the log file if .htaccess is not writable instead of failing silently
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/files.php b/lib/files.php index 885f6977fbd..705b7a6ca66 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; } |