Commit e560f4cc authored by Lev Walkin's avatar Lev Walkin

makeing it run on the older versions of Perl CGI package

parent 6d67d91c
...@@ -198,10 +198,12 @@ print LOG isoTime() . "\tIP=$ENV{REMOTE_ADDR}"; ...@@ -198,10 +198,12 @@ print LOG isoTime() . "\tIP=$ENV{REMOTE_ADDR}";
@gotSafeNames = (); @gotSafeNames = ();
@gotNames = param('file'); @gotNames = param('file');
if($#gotNames != -1 && $gotNames[0] ne "") { if($#gotNames != -1 && $gotNames[0] ne "") {
$gotFile = param('file');
@gotFiles = upload('file'); @gotFiles = upload('file');
} else { } else {
@gotNames = (); @gotNames = ();
@gotFiles = (); @gotFiles = ();
$gotFile = undef;
} }
if($#gotNames == -1) { if($#gotNames == -1) {
...@@ -237,22 +239,22 @@ if($#gotSafeNames >= 0) { ...@@ -237,22 +239,22 @@ if($#gotSafeNames >= 0) {
my $sandbox = $sessionDir . '/' . $transactionDir; my $sandbox = $sessionDir . '/' . $transactionDir;
mkdir($sandbox, $DM) or bark($SandBoxInitFailed); mkdir($sandbox, $DM) or bark($SandBoxInitFailed);
open(I, '> ' . $sandbox . '/+Names'); open(O, '> ' . $sandbox . '/+Names');
print I join("\n", @gotNames); print O join("\n", @gotNames);
open(I, '> ' . $sandbox . '/+safeNames'); open(O, '> ' . $sandbox . '/+safeNames');
print I join("\n", @gotSafeNames); print O join("\n", @gotSafeNames);
for(my $i = 0; $i <= $#gotSafeNames; $i++) { for(my $i = 0; $i <= $#gotSafeNames; $i++) {
local $name = $gotSafeNames[$i]; local $name = $gotSafeNames[$i];
open(I, '> ' . $sandbox . '/'. $name); open(O, '> ' . $sandbox . '/'. $name);
if($#gotFiles == -1) { if($#gotFiles == -1) {
print I scalar(param('text')); print O scalar(param('text'));
} else { } else {
while(<$gotFiles[$I]>) { while(<$gotFile>) {
print I; print O;
} }
} }
close(I);
} }
close(O);
my $inChDir = makeSessionDirName("/", $session) . $transactionDir; my $inChDir = makeSessionDirName("/", $session) . $transactionDir;
my $options = ''; my $options = '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment