Merge pull request #23374 from owncloud/fix-htaccess-issues
Write .htaccess update only if not already written
This commit is contained in:
commit
b9da594bd9
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue