Fixed handling of invalid urls
authorMarcel Werk <burntime@woltlab.com>
Wed, 13 Jul 2016 15:13:16 +0000 (17:13 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 13 Jul 2016 15:13:16 +0000 (17:13 +0200)
wcfsetup/install/files/lib/util/HTTPRequest.class.php

index 7c239438d66e0bf3e8f3f06a1d131859b35c4bd8..3ac741b96cf2ed633780be164ccfa254a93d5887 100644 (file)
@@ -217,6 +217,9 @@ final class HTTPRequest {
         */
        private function setURL($url) {
                $parsedUrl = $originUrl = parse_url($url);
+               if (empty($originUrl['scheme']) || empty($originUrl['host'])) {
+                       throw new SystemException("Invalid URL '{$url}' given");
+               }
                
                $this->originUseSSL = $originUrl['scheme'] === 'https';
                $this->originHost = $originUrl['host'];