From 4fa5996414498e95ddba22a5b6098e72849a75ca Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Oct 2025 18:15:13 -0600 Subject: [PATCH] fix for safe upgrade on 1.8 Signed-off-by: Andy Miller --- index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 07ec2a091..ad9bc902f 100644 --- a/index.php +++ b/index.php @@ -13,10 +13,6 @@ namespace Grav; \define('GRAV_PHP_MIN', '8.2.0'); -if (!\defined('GRAV_ROOT')) { - \define('GRAV_ROOT', __DIR__); -} - if (PHP_SAPI === 'cli-server') { $symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'] ?? '', 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'] ?? '', 'symfony') !== false; @@ -41,6 +37,10 @@ if (PHP_SAPI !== 'cli') { if ($path === '/___safe-upgrade-status') { $statusEndpoint = __DIR__ . '/user/plugins/admin/safe-upgrade-status.php'; + if (!\defined('GRAV_ROOT')) { + // Minimal bootstrap so the status script has the expected constants. + require_once __DIR__ . '/system/defines.php'; + } header('Content-Type: application/json; charset=utf-8'); if (is_file($statusEndpoint)) { require $statusEndpoint;