]> git.mxchange.org Git - friendica.git/commitdiff
Check the root directory is writable before copying .htaccess in Worker\Cron
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 14 Sep 2019 10:30:41 +0000 (06:30 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 14 Sep 2019 10:30:41 +0000 (06:30 -0400)
- Addresses https://github.com/friendica/friendica/issues/7298#issuecomment-531454632

src/Worker/Cron.php

index 0db70f5a8dddc801b86eafe9a6451979ce92eeeb..e43fde28efdf6ccf6453e2922e869c79b567e401 100644 (file)
@@ -104,7 +104,7 @@ class Cron
                // Ensure to have a .htaccess file.
                // this is a precaution for systems that update automatically
                $basepath = $a->getBasePath();
-               if (!file_exists($basepath . '/.htaccess')) {
+               if (!file_exists($basepath . '/.htaccess') && is_writable($basepath)) {
                        copy($basepath . '/.htaccess-dist', $basepath . '/.htaccess');
                }