From 96600d047543bd80d9ff6276912e2bb196abfc9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 19 Aug 2020 17:02:54 +0200 Subject: [PATCH] Use StringUtil::endsWith to validate package update server URL --- .../files/lib/acp/form/PackageUpdateServerAddForm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php index 3ba6f325e0..a4d5b5c87e 100755 --- a/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php @@ -80,7 +80,7 @@ class PackageUpdateServerAddForm extends AbstractForm { throw new UserInputException('serverURL', 'invalid'); } - if (preg_match('/^.*\.woltlab.com$/', Url::parse($this->serverURL)['host'])) { + if (StringUtil::endsWith(Url::parse($this->serverURL)['host'], '.woltlab.com', true)) { throw new UserInputException('serverURL', 'woltlab'); } -- 2.20.1