From 6ac3a7bfe48e72b687c5727cd60f88b9724da4ac Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 1 Aug 2022 16:46:38 +0900 Subject: [PATCH] fix: move PHP version check to index.php/spark If we use new syntax in new PHP version when dropping older PHP version support, syntax error occurs before the PHP version check. --- public/index.php | 12 ++++++++++++ spark | 12 ++++++++++++ system/CodeIgniter.php | 13 +------------ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/public/index.php b/public/index.php index 51f4be81e731..96e7f45ff4ac 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,17 @@ startTime = microtime(true); $this->config = $config; } @@ -962,6 +950,7 @@ protected function display404errors(PageNotFoundException $e) ob_end_flush(); // @codeCoverageIgnore } + // Throws new PageNotFoundException and remove exception message on production. throw PageNotFoundException::forPageNotFound( (ENVIRONMENT !== 'production' || ! $this->isWeb()) ? $e->getMessage() : null );