$file_content = $upload->slurp;
}
- if ($filename !~ /\A\w[\w\.]*\.\w+\z/) {
+ if ($filename !~ /\A\w[\w-\.]*\.\w+\z/) {
# print STDERR "FILENAME2 = " . $upload->filename . "\n";
return $c->render(template => 'forbidden', status => 403);
}
};
get '/<filename>.<ext>'
- => [ filename => qr/\w[\w\.]*/, ext => qr/\w+/ ]
+ => [ filename => qr/\w[\w-\.]*/, ext => qr/\w+/ ]
=> sub ($c) {
my $fullname = $c->param('filename').'.'.$c->param('ext');
my $file = $datadir->child($fullname);
$c->render;
} => 'default';
+app->mode(app->config->{mode});
app->start;
__DATA__
<%= content %>
<div class="footer">
Created by <b>Yenya's Paste Bin</b>,
- <a href="https://www.fi.muni.cz/~kas/git/paste/">www.fi.muni.cz/~kas/git/paste</a>
+ <a href="https://www.fi.muni.cz/~kas/git/paste.git/">www.fi.muni.cz/~kas/git/paste</a>
</div>
</div></body>
</html>