use PVE::INotify;
use PVE::SafeSyslog;
-use PVE::Tools;
+use PVE::Tools qw(trim);
use PVE::APIServer::Formatter;
use PVE::APIServer::Utils;
sub file_upload_multipart {
my ($self, $reqstate, $auth, $method, $path, $rstate) = @_;
- my $trim = sub {
- $_[0] =~ /\s*(\S+)/;
- return $1;
- };
-
eval {
my $boundary = $rstate->{boundary};
my $hdl = $reqstate->{hdl};
my ($name) = @_;
if ($hdl->{rbuf} =~ s/^${delim_re}Content-Disposition: (.*?); name="$name"(.*?)($delim_re)/$3/s) {
assert_form_disposition($1);
- $rstate->{params}->{$name} = $trim->($2);
+ $rstate->{params}->{$name} = trim($2);
}
};
assert_form_disposition($1);
die "wrong field name '$2' for file upload, expected 'filename'" if $2 ne "filename";
$rstate->{phase} = 2;
- $rstate->{params}->{filename} = $trim->($3);
+ $rstate->{params}->{filename} = trim($3);
}
}