Skip to content

Commit

Permalink
Merge pull request #42298 from nextcloud/readOnlyFSFalse
Browse files Browse the repository at this point in the history
Don't write back .htaccess file on a RO filesystem
  • Loading branch information
solracsf authored Dec 19, 2023
2 parents e8275ab + b22ac93 commit 5077d0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ public static function updateHtaccess() {
\OCP\Server::get(Installer::class)
);

if (!is_writable($setupHelper->pathToHtaccess())) {
return false;
}

$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
$content = "#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####\n";
$htaccessContent = explode($content, $htaccessContent, 2)[0];
Expand Down

0 comments on commit 5077d0a

Please sign in to comment.