From 28a0be939c0e524e52ec1096c74ed8603cd4fe61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 11 May 2022 16:25:45 +0200 Subject: [PATCH] Add update_com.woltlab.wcf_5.5_checkUpdateServers.php --- ...com.woltlab.wcf_5.5_checkUpdateServers.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkUpdateServers.php diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkUpdateServers.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkUpdateServers.php new file mode 100644 index 0000000000..7b547eddbb --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkUpdateServers.php @@ -0,0 +1,40 @@ + + * @package WoltLabSuite\Core + */ + +use Laminas\Diactoros\Uri; +use wcf\data\package\update\server\PackageUpdateServerList; +use wcf\system\WCF; + +$list = new PackageUpdateServerList(); +$list->readObjects(); + +foreach ($list as $server) { + $uri = new Uri($server->serverURL); + + if ($uri->getScheme() !== 'https') { + if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { + $message = "Der Paketserver '{$uri}' verwendet das unverschlüsselte http-Protokoll."; + } else { + $message = "The package server '{$uri}' uses the unencrypted 'http' scheme."; + } + + throw new \RuntimeException($message); + } + if ($uri->getPort()) { + if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { + $message = "Der Paketserver '{$uri}' verwendet nicht den Standard-Port."; + } else { + $message = "The package server '{$uri}' uses a non-standard port."; + } + + throw new \RuntimeException($message); + } +} -- 2.20.1