Escape URLs properly
This commit is contained in:
parent
2b060366f0
commit
0c61594252
|
@ -219,6 +219,8 @@ sub get_entry($fullpath) {
|
|||
return undef;
|
||||
}
|
||||
|
||||
my $url = Mojo::URL->new("https://unix.dog/announcement/");
|
||||
$url->path(basename($fullpath));
|
||||
|
||||
return {
|
||||
raw => $announce_content,
|
||||
|
@ -226,6 +228,7 @@ sub get_entry($fullpath) {
|
|||
date => $filestat->mtime,
|
||||
filename => basename($fullpath),
|
||||
title => $announce_title,
|
||||
url => $url,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<h2><%= $entry->{"title"} %></h2>
|
||||
<p>
|
||||
Posted <%= localtime($entry->{"date"})->strftime() %>.
|
||||
<a href="/announcement/<%= $entry->{"filename"} %>">Download PGP signature.</a>
|
||||
<a href="<% $entry->{url} %>">Download PGP signature.</a>
|
||||
<p>
|
||||
<pre><%= $entry->{"text"} %></pre>
|
||||
</article>
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
% foreach my $item (@$items) {
|
||||
<item>
|
||||
<title><![CDATA[<%= $item->{'title'} %>]]></title>
|
||||
<link>https://unix.dog/announcement/<%= $item->{'filename'} %></link>
|
||||
<guid isPermaLink="true">https://unix.dog/announcement/<%= $item->{'filename'} %></guid>
|
||||
<link><%= $item->{'url'} %></link>
|
||||
<guid isPermaLink="true"><%= $item->{'url'} %></guid>
|
||||
<description><![CDATA[<%== $item->{'text'} %>]]></description>
|
||||
<author>Alpha</author>
|
||||
<author>alpha@unix.dog</author>
|
||||
<pubDate><%= localtime($item->{'date'})->strftime("%a, %d %b %Y %H:%M:%S %z") %></pubDate>
|
||||
</item>
|
||||
% }
|
||||
|
|
Loading…
Reference in New Issue