From 1b3d679172d063c18bc687e7b3aa7df0a68d5eb1 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 11 Jun 2023 18:42:02 +0100 Subject: [PATCH] mason/.perl-lib/TrivGal.pm (Image::scale): Return encoded URL. Also, apply HTML-encoding as necessary, because I'd failed to do that. --- mason/.perl-lib/TrivGal.pm | 4 +++- mason/dhandler | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mason/.perl-lib/TrivGal.pm b/mason/.perl-lib/TrivGal.pm index 600e9f5..eadb8c3 100644 --- a/mason/.perl-lib/TrivGal.pm +++ b/mason/.perl-lib/TrivGal.pm @@ -219,11 +219,13 @@ package TrivGal::Image { sub scale ($$) { my ($me, $scale) = @_; + my $m = HTML::Mason::Request->instance; my $path = $me->{path}; my $sz = $SIZE{$scale} or die "unknown scale `$scale'"; my $thumb = "$CACHE/scale.$sz/$path"; - my $thumburl = "$CACHEURL/scale.$sz/$path"; + my $thumburl = + $m->interp->apply_escapes("$CACHEURL/scale.$sz/$path", "u"); my $st = stat $thumb; if (defined $st && $st->mtime > $me->{mtime}) { return $thumburl; } diff --git a/mason/dhandler b/mason/dhandler index 979419d..91a513b 100755 --- a/mason/dhandler +++ b/mason/dhandler @@ -255,12 +255,12 @@ Failed to find ‘<% $path |h %>’. % else { $tn = "$STATICURL/folder.svg"; } % if ($focus) {
- +
<% $caption %>
% } else {
- +
<% $caption %> % if (defined $comment) { -- 2.11.0