From 74d93269da6182023e35c8d4ddf7bd5aba9b4309 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 23 Aug 2019 07:19:08 +0200 Subject: [PATCH] Prevent a fatal error for an empty parameter in "unparseURL" --- src/Content/Text/HTML.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index c8bed0b9d6..ddc587d72a 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -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); -- 2.39.5