From 737dd2857235970b598a49dc1d987c73c8a38a08 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 18 May 2017 01:36:40 +0200 Subject: [PATCH 1/1] source: link back to resulting page --- common.inc.plp | 1 + source.plp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common.inc.plp b/common.inc.plp index 6672bd5..5f7cb25 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -180,6 +180,7 @@ EOT sub showlink { my ($title, $href, $selected) = @_; return sprintf( + !$href ? '%s' : $selected ? '%s' : '%s', EscapeHTML($title), EscapeHTML($href) ); diff --git a/source.plp b/source.plp index 931b3dc..ea85628 100644 --- a/source.plp +++ b/source.plp @@ -54,7 +54,8 @@ if (not $source) { say "\n"; } else { - say "

Source of $source

"; + my $href = showlink($source, $source =~ m{\A (\w+) \.plp \z}x && "/$1"); + say "

Source of $href

"; if ($source =~ m{(?:/|^)\.}) { die "File request not permitted\n"; -- 2.30.0