Use StringUtil::endsWith to validate package update server URL
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 Aug 2020 15:02:54 +0000 (17:02 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 Aug 2020 15:02:54 +0000 (17:02 +0200)
wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php

index 3ba6f325e0e92e4f46f61cadf9952ba941eaa898..a4d5b5c87efbbdebda2b10fef4cb9b2aebdb36cf 100755 (executable)
@@ -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');
                }