Show error message if Grav is symlinked, and stop the upgrade process

This commit is contained in:
Flavio Copes
2015-08-06 16:35:45 +02:00
parent 473511d948
commit 66764b2255
2 changed files with 7 additions and 2 deletions

View File

@@ -695,6 +695,11 @@ class AdminController
return;
}
if (is_link(ROOT_DIR . 'index.php')) {
$this->admin->json_response = ['status' => 'error', 'message' => 'Cannot upgrade: Grav is symlinked. Please upgrade manually'];
return false;
}
$result = \Grav\Plugin\Admin\Gpm::selfupgrade();
if ($result) {

View File

@@ -173,7 +173,7 @@ class Gpm
$file = self::_downloadSelfupgrade($update, $tmp);
Installer::install($file, GRAV_ROOT,
['sophisticated' => true, 'overwrite' => true, 'ignore_symlinks' => false]);
['sophisticated' => true, 'overwrite' => true, 'ignore_symlinks' => true]);
$errorCode = Installer::lastErrorCode();
@@ -185,4 +185,4 @@ class Gpm
return true;
}
}
}