use Modern::Perl;
use Digest::SHA;
use Fcntl;
use Encode;
use C4::Context;
sub UploadFile {
my ($filename, $dir, $handle) = @_;
if($filename =~ m#/(^|/)\.\.(/|$)# or $dir =~ m#(^|/)\.\.(/|$)#) {
$filename = decode_utf8($filename);
if($filename =~ m#(^|/)\.\.(/|$)# or $dir =~ m#(^|/)\.\.(/|$)#) {
warn "Filename or dirname contains '..'. Aborting upload";
return;
}
-