version 1.63, 2004/09/10 20:05:03
|
version 1.64, 2004/12/28 21:28:49
|
Line 289 sub checksuffix {
|
Line 289 sub checksuffix {
|
} |
} |
|
|
sub cleanDest { |
sub cleanDest { |
my ($request,$dest,$subdir,$fn)=@_; |
my ($request,$dest,$subdir,$fn,$uname)=@_; |
#remove bad characters |
#remove bad characters |
my $foundbad=0; |
my $foundbad=0; |
if ($subdir && $dest =~/\./) { |
if ($subdir && $dest =~/\./) { |
Line 302 sub cleanDest {
|
Line 302 sub cleanDest {
|
} |
} |
if ($dest=~m|/|) { |
if ($dest=~m|/|) { |
my ($newpath)=($dest=~m|(.*)/|); |
my ($newpath)=($dest=~m|(.*)/|); |
if (! -d "$fn/$newpath") { |
$newpath=&relativeDest($fn,$newpath,$uname); |
$request->print("<p><font color=\"red\">".&mt('You request to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"<tt>'.$newpath.'</tt>"')."</font></p>"); |
if (! -d "$newpath") { |
|
$request->print("<p><font color=\"red\">".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"<tt>'.$newpath.'</tt>"')."</font></p>"); |
$dest=~s|.*/||; |
$dest=~s|.*/||; |
} |
} |
} |
} |
Line 767 sub phaseone {
|
Line 768 sub phaseone {
|
|
|
my $doingdir=0; |
my $doingdir=0; |
if ($ENV{'form.action'} eq 'newdir') { $doingdir=1; } |
if ($ENV{'form.action'} eq 'newdir') { $doingdir=1; } |
my $newfilename=&cleanDest($r,$ENV{'form.newfilename'},$doingdir,$fn); |
my $newfilename=&cleanDest($r,$ENV{'form.newfilename'},$doingdir,$fn,$uname); |
$newfilename=&relativeDest($fn,$newfilename,$uname); |
$newfilename=&relativeDest($fn,$newfilename,$uname); |
$r->print('<form action="/adm/cfile" method="post">'. |
$r->print('<form action="/adm/cfile" method="post">'. |
'<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'. |
'<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'. |