Merge pull request #23374 from owncloud/fix-htaccess-issues

Write .htaccess update only if not already written
This commit is contained in:
Thomas Müller 2016-03-21 09:43:18 +01:00
commit b9da594bd9
1 changed files with 20 additions and 20 deletions

View File

@ -411,14 +411,12 @@ class Setup {
$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
$content = "#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####\n";
if (strpos($htaccessContent, 'ErrorDocument 403') === false) {
if(strpos($htaccessContent, $content) === false) {
//custom 403 error page
$content.= "\nErrorDocument 403 ".\OC::$WEBROOT."/core/templates/403.php";
}
if (strpos($htaccessContent, 'ErrorDocument 404') === false) {
//custom 404 error page
$content.= "\nErrorDocument 404 ".\OC::$WEBROOT."/core/templates/404.php";
}
// Add rewrite base
$webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
@ -439,6 +437,8 @@ class Setup {
}
}
}
public static function protectDataDirectory() {
//Require all denied
$now = date('Y-m-d H:i:s');