mason/dhandler: Apply both URL and HTML escaping to links.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 17 Jun 2023 14:30:02 +0000 (15:30 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 17 Jun 2023 14:30:02 +0000 (15:30 +0100)
mason/dhandler

index 44ab7ed..f3a8cfc 100755 (executable)
@@ -35,8 +35,8 @@ of the GNU Affero General Public License.
 <html>
 <head>
   <meta name=viewport content="width=device-width initial-scale=1.0">
-  <script type="text/javascript" src="<% "$STATICURL/tgal.js" |u %>" defer></script>
-  <link rel=stylesheet type=text/css href="<% "$STATICURL/tgal.css" |u %>">
+  <script type="text/javascript" src="<% "$STATICURL/tgal.js" |hu %>" defer></script>
+  <link rel=stylesheet type=text/css href="<% "$STATICURL/tgal.css" |hu %>">
 <% $head %>\
   <title><% $title %></title>
 </head>
@@ -215,13 +215,13 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 %
 <div class=viewnav>
 % if ($link{prev}) {
-  <div class=prev><a class=prev href="<% "$pre/$link{prev}" |u %>">&lsaquo;</a></div>
+  <div class=prev><a class=prev href="<% "$pre/$link{prev}" |hu %>">&lsaquo;</a></div>
 % }
   <a class=view href="<% $url |h %>">
     <img src="<% $vw |h %>">
   </a>
 % if ($link{next}) {
-  <div class=next><a class=next href="<% "$pre/$link{next}" |u %>">&rsaquo;</a></div>
+  <div class=next><a class=next href="<% "$pre/$link{next}" |hu %>">&rsaquo;</a></div>
 % }
 </div>
 %
@@ -254,11 +254,11 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 % if (!@p) {
 [top]
 % } else {
-<a href="<% $SCRIPTURL |u %>/">[top]</a>&thinsp;/&thinsp;\
+<a href="<% $SCRIPTURL |hu %>/">[top]</a>&thinsp;/&thinsp;\
 %   STEP: for my $p (@p) {
 %     if (defined $prev) {
 %       $pp .= "$prev/";
-<a href="<% join_paths($SCRIPTURL, $pp) |u %>/">\
+<a href="<% join_paths($SCRIPTURL, $pp) |hu %>/">\
 <% $prev %></a>&thinsp;/&thinsp;\
 %     }
 %     $prev = $p;
@@ -309,7 +309,7 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 </%perl>
 <div class=footer>
   <div class=footitem>
-    <a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img class=licence src="<% "$STATICURL/agpl.png" |u %>"></a>
+    <a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img class=licence src="<% "$STATICURL/agpl.png" |hu %>"></a>
     Trivial Gallery, copyright &copy; 2021 Mark Wooding.
     Free software: you can modify it and/or redistribute it under the
     terms of the