From 58f06a948991564d3569e8f3a1be4b4ae6955f7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:16:19 +0000 Subject: [PATCH 1/7] build(deps-dev): update rector/rector requirement from 0.18.4 to 0.18.5 Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.18.4...0.18.5) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 27e77b515910..cd134a93f9bd 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "phpunit/phpcov": "^8.2", "phpunit/phpunit": "^9.1", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "0.18.4", + "rector/rector": "0.18.5", "vimeo/psalm": "^5.0" }, "suggest": { From 02e8805693e5529afa147f2e3a1c49423c1b1116 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 6 Oct 2023 05:08:27 +0700 Subject: [PATCH 2/7] remove CountOnNullRector from skip list as now deprecated --- rector.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rector.php b/rector.php index 0cbfa41114b1..c2b76343dfff 100644 --- a/rector.php +++ b/rector.php @@ -35,7 +35,6 @@ use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Php70\Rector\FuncCall\RandomFunctionRector; -use Rector\Php71\Rector\FuncCall\CountOnNullRector; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\PHPUnit\Set\PHPUnitSetList; @@ -105,9 +104,6 @@ __DIR__ . '/system/Session/Handlers', ], - // sometime too detail - CountOnNullRector::class, - // use mt_rand instead of random_int on purpose on non-cryptographically random RandomFunctionRector::class, From 7f3b27a85c68d962ad9ea7f5ac1348bae54fb2f1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 6 Oct 2023 11:32:34 +0900 Subject: [PATCH 3/7] fix: CI returns 200 OK to PageNotFound --- system/CodeIgniter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index dd00746bf567..95be7771b281 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -979,8 +979,7 @@ protected function display404errors(PageNotFoundException $e) // Display 404 Errors $this->response->setStatusCode($e->getCode()); - echo $this->outputBufferingEnd(); - flush(); + $this->outputBufferingEnd(); // Throws new PageNotFoundException and remove exception message on production. throw PageNotFoundException::forPageNotFound( From 33708a88bb3a7897f24861d74d8172dbdcf49bcc Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 6 Oct 2023 11:59:17 +0900 Subject: [PATCH 4/7] docs: add changelog --- user_guide_src/source/changelogs/v4.4.2.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.2.rst b/user_guide_src/source/changelogs/v4.4.2.rst index 6da0e5a04953..68cba760c549 100644 --- a/user_guide_src/source/changelogs/v4.4.2.rst +++ b/user_guide_src/source/changelogs/v4.4.2.rst @@ -32,6 +32,9 @@ Deprecations Bugs Fixed ********** +- **CodeIgniter:** Fixed a bug that returned "200 OK" response status code when + Page Not Found. + See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed. From b7b69395e0cdd74982b619d789c647f9d0819c9d Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 6 Oct 2023 13:38:59 +0900 Subject: [PATCH 5/7] style: remove duplicate () --- system/Debug/Toolbar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index 19a67b455db3..73c777ba7289 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -83,7 +83,7 @@ public function run(float $startTime, float $totalTime, RequestInterface $reques $data['isAJAX'] = $request->isAJAX(); $data['startTime'] = $startTime; $data['totalTime'] = $totalTime * 1000; - $data['totalMemory'] = number_format((memory_get_peak_usage()) / 1024 / 1024, 3); + $data['totalMemory'] = number_format(memory_get_peak_usage() / 1024 / 1024, 3); $data['segmentDuration'] = $this->roundTo($data['totalTime'] / 7); $data['segmentCount'] = (int) ceil($data['totalTime'] / $data['segmentDuration']); $data['CI_VERSION'] = CodeIgniter::CI_VERSION; From 11647e1ceb3aca3b0dd652a866f2da0e3153b937 Mon Sep 17 00:00:00 2001 From: Mostafa Khudair <59371810+mostafakhudair@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:01:08 +0300 Subject: [PATCH 6/7] docs: fix class name --- user_guide_src/source/extending/core_classes/003.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/extending/core_classes/003.php b/user_guide_src/source/extending/core_classes/003.php index c726b71ea95d..aefc135c62e2 100644 --- a/user_guide_src/source/extending/core_classes/003.php +++ b/user_guide_src/source/extending/core_classes/003.php @@ -4,7 +4,7 @@ use CodeIgniter\Router\RouteCollection; -class RouteCollection extends RouteCollection +class MyRouteCollection extends RouteCollection { // ... } From 749753225a95757f3f32bf67318b9b14f688aa49 Mon Sep 17 00:00:00 2001 From: Mostafa Khudair <59371810+mostafakhudair@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:20:23 +0300 Subject: [PATCH 7/7] apply suggestion --- user_guide_src/source/extending/core_classes/003.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/extending/core_classes/003.php b/user_guide_src/source/extending/core_classes/003.php index aefc135c62e2..9e89d87d46df 100644 --- a/user_guide_src/source/extending/core_classes/003.php +++ b/user_guide_src/source/extending/core_classes/003.php @@ -2,9 +2,9 @@ namespace App\Libraries; -use CodeIgniter\Router\RouteCollection; +use CodeIgniter\Router\RouteCollection as BaseRouteCollection; -class MyRouteCollection extends RouteCollection +class RouteCollection extends BaseRouteCollection { // ... }