From: Tim Düsterhus Date: Wed, 11 May 2022 14:25:45 +0000 (+0200) Subject: Add update_com.woltlab.wcf_5.5_checkUpdateServers.php X-Git-Tag: 6.0.0_Alpha_1~1309^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28a0be939c0e524e52ec1096c74ed8603cd4fe61;p=GitHub%2FWoltLab%2FWCF.git Add 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); + } +}