X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/b22f63ba31441200ca915c64445d5a87d146c327..d2757291a8dc92fd2d396ff35dad0d7af8bc2f53:/source.plp?ds=inline diff --git a/source.plp b/source.plp index 097f0ac..56193fb 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 @@ -68,7 +67,6 @@ else { } -r $source or die "Requested file not found\n"; - require Encode; if (eval { require Text::VimColor and Text::VimColor->VERSION(0.12) }) { delete $Text::VimColor::SYNTAX_TYPE{Underlined}; my %TYPETAG = ( @@ -85,7 +83,7 @@ else { say '
'; foreach (@$parsed) { my ($type, $contents) = @{$_}; - $contents = Encode::decode_utf8($contents); + $contents = decode_utf8($contents); my $tag = $type && ($TYPETAG{$type} || 'span'); my $arg = ''; print "<$tag$arg class=\"sy-\l$type\">" if $tag; @@ -110,7 +108,7 @@ else { } else { say ''; - print EscapeHTML(Encode::decode_utf8(ReadFile($source))); + print EscapeHTML(decode_utf8(ReadFile($source))); say ''; }