From: Mischa POSLAWSKY Date: Wed, 17 May 2017 23:36:40 +0000 (+0200) Subject: source: link back to resulting page X-Git-Tag: v1.11~70 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/737dd2857235970b598a49dc1d987c73c8a38a08 source: link back to resulting page --- 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";