From 7909145a2de00f9892ddbc65181268e870eefa3d Mon Sep 17 00:00:00 2001 From: David Janssens Date: Sun, 29 Dec 2024 10:59:37 +0100 Subject: [PATCH] fix:add array declarations to installer (#1604) * fix:add array declarations to installer to fix deprecated dynamic properties error * fix:update variable declarations + add return declarations * fix:update variable declarations + add return declarations - correctly this time --- htdocs/install/class/IcmsInstallWizard.php | 41 ++++++++++++---------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/install/class/IcmsInstallWizard.php b/htdocs/install/class/IcmsInstallWizard.php index 3f227fa620ed..c7bb039809ff 100644 --- a/htdocs/install/class/IcmsInstallWizard.php +++ b/htdocs/install/class/IcmsInstallWizard.php @@ -1,16 +1,19 @@ checkAccess()) { return false; } @@ -18,7 +21,7 @@ function xoInit() { $_SERVER['REQUEST_URI'] = htmlentities($_SERVER['PHP_SELF']); } - if (PHP_VERSION_ID < 70000) { + if (PHP_VERSION_ID < 70400) { $this->no_php5 = true; } /* @@ -99,7 +102,7 @@ function xoInit() { return true; } - function checkAccess() { + public function checkAccess(): bool { if (INSTALL_USER && INSTALL_PASSWORD) { if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="ImpressCMS Installer"'); @@ -121,7 +124,7 @@ function checkAccess() { return true; } - function loadLangFile($file) { + public function loadLangFile($file) { if (file_exists("./language/$this->language/$file.php")) { include_once "./language/$this->language/$file.php"; } else { @@ -129,7 +132,7 @@ function loadLangFile($file) { } } - function initLanguage($language) { + public function initLanguage($language) { $language = preg_replace('/[^A-Za-z]+/', '', $language); if (!file_exists("./language/$language/install.php")) { $language = 'english'; @@ -138,7 +141,7 @@ function initLanguage($language) { $this->loadLangFile('install'); } - function setPage($page) { + public function setPage($page): string { /** * If server is PHP 4, display the php4 page and stop the install */ @@ -166,7 +169,7 @@ function setPage($page) { return $this->currentPage; } - function baseLocation() { + public function baseLocation(): string { $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http'; $host = htmlentities($_SERVER['HTTP_HOST']); $server_php_self = htmlentities($_SERVER['PHP_SELF']); @@ -174,7 +177,7 @@ function baseLocation() { return "$proto://$host$base"; } - function pageURI($page) { + public function pageURI($page): string { if (!(int) $page[0]) { if ($page[0] === '+') { $page = $this->currentPage + substr($page, 1); @@ -188,11 +191,11 @@ function pageURI($page) { return $this->baseLocation() . "/page_$page.php"; } - function redirectToPage($page, $status = 303, $message = 'See other') { + public function redirectToPage($page, $status = 303, $message = 'See other') { $location = $this->pageURI($page); $proto = !@empty($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; header("$proto $status $message"); // header( "Status: $status $message" ); header("Location: $location"); } -} \ No newline at end of file +}