diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-09-10 22:05:20 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-09-10 22:05:20 +0200 |
commit | 65aab3dc8c88f012e063ccea7cacc17f528b7d4d (patch) | |
tree | 281c65eb0e9095dc1bcd68c9ef51ae1afa9018ed /lib | |
parent | 8ae612f6930235aa1768d3a5beeff65a3565d90a (diff) | |
download | nextcloud-server-65aab3dc8c88f012e063ccea7cacc17f528b7d4d.tar.gz nextcloud-server-65aab3dc8c88f012e063ccea7cacc17f528b7d4d.zip |
Check for failure in creating htaccessWorking testfile
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/util.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/util.php b/lib/util.php index 0777643a952..e8e3bc37e5f 100755 --- a/lib/util.php +++ b/lib/util.php @@ -689,9 +689,13 @@ class OC_Util { return false; } - $fp = @fopen($testfile, 'w'); - @fwrite($fp, $testcontent); - @fclose($fp); + $fp = @fopen($testFile, 'w'); + if (!$fp) { + throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', + 'Make sure it is possible for the webserver to write to '.$testFile); + } + fwrite($fp, $testContent); + fclose($fp); // accessing the file via http $url = OC_Helper::makeURLAbsolute(OC::$WEBROOT.'/data'.$fileName); @@ -700,7 +704,7 @@ class OC_Util { @fclose($fp); // cleanup - @unlink($testfile); + @unlink($testFile); // does it work ? if($content==$testContent) { |