Prevent a fatal error for an empty parameter in "unparseURL"
authorMichael Vogel <icarus@dabo.de>
Fri, 23 Aug 2019 05:19:08 +0000 (07:19 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 23 Aug 2019 05:19:08 +0000 (07:19 +0200)
src/Content/Text/HTML.php

index c8bed0b..ddc587d 100644 (file)
@@ -419,6 +419,10 @@ class HTML
                $link = $matches[0];
                $url = $matches[1];
 
+               if (empty($url) || empty(parse_url($url))) {
+                       return $matches[0];
+               }
+
                $parts = array_merge($base, parse_url($url));
                $url2 = Network::unparseURL($parts);