$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);