X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/81aefba6ac586eccbe18b4e90efc175e34fff5ad..108d13f833e9daeff4ea1552e2e1bee1e0ed8c22:/source.plp diff --git a/source.plp b/source.plp index 7facf51..38af1fa 100644 --- a/source.plp +++ b/source.plp @@ -1,7 +1,6 @@ <(common.inc.plp)><: -my $source = $ENV{PATH_INFO}; -$source =~ s{^/}{}; +my $source = $Request; if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) { # convert perl include to json construct @@ -39,21 +38,21 @@ Html({ stylesheet => [qw'light dark mono red'], }); -print "\n"; +say ''; if (not $source) { print "

Source files

"; print "

Project code distributed under the AGPL. Please contribute back.

"; - print '\n"; } else { - print "

Source of $source

\n"; + say "

Source of $source

"; if ($source =~ m{(?:/|^)\.}) { die "File request not permitted\n"; @@ -82,7 +81,7 @@ else { vim_options => [@Text::VimColor::VIM_OPTIONS, '+:set enc=utf-8'], ); my $parsed = $hl->marked; - print "
\n";
+		say '
';
 		foreach (@$parsed) {
 			my ($type, $contents) = @{$_};
 			$contents = Encode::decode_utf8($contents);
@@ -106,14 +105,14 @@ else {
 			print Text::VimColor::_xml_escape($contents);
 			print "" if $tag;
 		}
-		print "
\n"; + say '
'; } else { - print "
\n";
+		say '
';
 		print EscapeHTML(Encode::decode_utf8(ReadFile($source)));
-		print "
\n"; + say '
'; } - print "\n"; + say ''; }