From: Tim Düsterhus Date: Wed, 19 Aug 2020 15:02:54 +0000 (+0200) Subject: Use StringUtil::endsWith to validate package update server URL X-Git-Tag: 5.3.0_Alpha_1~22^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=96600d047543bd80d9ff6276912e2bb196abfc9e;p=GitHub%2FWoltLab%2FWCF.git Use StringUtil::endsWith to validate package update server URL --- 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'); }