mdlinkcheck: reject URLs containing quotes

Those would be illegal anyway and would make the script misbehave

Reported-by: Stanislav Fort
Closes #18889
This commit is contained in:
Daniel Stenberg 2025-10-06 16:10:27 +02:00
parent e214b14501
commit 71b5e02590
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -140,6 +140,10 @@ sub checkurl {
print "check $url\n";
my $curlcmd="curl -ILfsm10 --retry 2 --retry-delay 5 -A \"Mozilla/curl.se link-probe\"";
$url =~ s/\+/%2B/g;
if($url =~ /[\"\'\n]/) {
print STDERR "Bad URL in markdown: %s\n", $url{$url};
return 1; # fail
}
my @content = `$curlcmd \"$url\"`;
if(!$content[0]) {
print STDERR "FAIL\n";