From 88eb9f915a052847d6a2d56708fdabb4f129ef44 Mon Sep 17 00:00:00 2001 From: Ron Wardenier Date: Fri, 5 Jan 2024 12:44:44 +0100 Subject: [PATCH] Allow empty and maolformed links in markdown (#3782) When a user adds an invalid link in a page in markdown for example [](https://) and that page is parsed to be shown in a blog listing page that blog listing page crashes with a CRITICAL error. Instead of throwing an error the URL is now ignored. See also https://discord.com/channels/501836936584101899/506916956637495306/1185616779486167141 --- system/src/Grav/Common/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index 0aefd5079e..a0fb949f85 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -1835,7 +1835,7 @@ static function ($matches) { $parts = parse_url($enc_url); if ($parts === false) { - throw new InvalidArgumentException('Malformed URL: ' . $url); + $parts = []; } foreach ($parts as $name => $value) {