Skip to content

Commit

Permalink
Allow empty and maolformed links in markdown (#3782)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bleutzinn authored Jan 5, 2024
1 parent 70e5262 commit 88eb9f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 88eb9f9

Please sign in to comment.