]> source.dussan.org Git - nextcloud-server.git/commitdiff
write a warning to the log file if .htaccess is not writable instead of failing silently
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Jun 2012 09:50:21 +0000 (11:50 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Jun 2012 09:50:21 +0000 (11:50 +0200)
lib/files.php

index 885f6977fbd15715dd36829401641654b3948ef1..705b7a6ca66fefa2ad212ce8ed95faab8e5bb170 100644 (file)
@@ -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;
        }