From e5b5d36e00f3480c6af8080056bb8a4b323bcba1 Mon Sep 17 00:00:00 2001 From: xRealNeon Date: Thu, 22 Dec 2022 15:53:12 +0100 Subject: [PATCH 1/2] Fixed some php 8 errors --- code/site/controllers/http.php | 8 +------- code/site/libraries/plugin.php | 8 ++++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/code/site/controllers/http.php b/code/site/controllers/http.php index 5afb853..0e091f8 100644 --- a/code/site/controllers/http.php +++ b/code/site/controllers/http.php @@ -175,13 +175,7 @@ private function respond($response) */ private function resetDocumentType() { - if (!headers_sent()) - { - foreach (headers_list() as $header) - { - header_remove($header); - } - } + header_remove(); //JResponse::clearHeaders(); } } diff --git a/code/site/libraries/plugin.php b/code/site/libraries/plugin.php index 393e68b..a98cc62 100755 --- a/code/site/libraries/plugin.php +++ b/code/site/libraries/plugin.php @@ -334,7 +334,7 @@ final public function fetchResource($resource_name = null) * * @since 1.0 */ - final private function checkInternally($resource_name) + private function checkInternally($resource_name) { if (! method_exists($this, $resource_name)) { @@ -356,7 +356,7 @@ final private function checkInternally($resource_name) * * @since 1.0 */ - final private function checkRequestLimit() + private function checkRequestLimit() { $app = Factory::getApplication(); $limit = $this->params->get('request_limit', 0); @@ -415,7 +415,7 @@ final private function checkRequestLimit() * * @since 1.0 */ - final private function log() + private function log() { if (! $this->params->get('log_requests')) { @@ -476,7 +476,7 @@ final private function log() * * @since 1.0 */ - final private function lastUsed() + private function lastUsed() { $app = Factory::getApplication(); $table = Table::getInstance('Key', 'ApiTable'); From 4ea7b4aaef0e5eeeefd3f14102b47502adaac1e6 Mon Sep 17 00:00:00 2001 From: xRealNeon Date: Fri, 23 Dec 2022 16:01:36 +0100 Subject: [PATCH 2/2] Made header method downwards compatible --- code/site/controllers/http.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/site/controllers/http.php b/code/site/controllers/http.php index 0e091f8..57407e5 100644 --- a/code/site/controllers/http.php +++ b/code/site/controllers/http.php @@ -175,7 +175,13 @@ private function respond($response) */ private function resetDocumentType() { - header_remove(); + if (!headers_sent()) + { + foreach (headers_list() as $header) + { + header_remove(explode(":", $header, 2)[0]); + } + } //JResponse::clearHeaders(); } }