From 7aca0d40a359e0b9b31b7dc9327dba76da51c85c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 21 Jan 2016 08:40:14 +0000 Subject: Compose relative URLs in RSS feeds correctly If the relative link from the (page generating the) RSS to the target would start with "./" or "../", just concatenating it with the URL to the directory containing the RSS is not sufficient. Go via URI::new_abs to fix this. --- IkiWiki/Plugin/inline.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 5ea5f35af..c3895d982 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -613,7 +613,7 @@ sub absolute_urls ($$) { $v=$baseurl.$v; # anchor } elsif ($dv=~/^(?!\w+:)[^\/]/) { - $v=$url.$v; # relative url + $v=URI->new_abs($v, $url)->canonical; # relative url } elsif ($dv=~/^\//) { if (! defined $urltop) { -- cgit v1.2.3