--- loncom/interface/portfolio.pm 2004/08/24 07:26:04 1.27 +++ loncom/interface/portfolio.pm 2004/08/24 07:35:57 1.29 @@ -180,7 +180,7 @@ sub display_directory { $r->print($displayOut); $r->print(''); my @tree = split (/\//,$current_path); - $r->print(''.&make_anchor('/','/')); + $r->print(''.&make_anchor('portfolio','/').'/'); if (@tree > 1){ my $newCurrentPath = ''; for (my $i = 1; $i< @tree; $i++){ @@ -345,10 +345,17 @@ sub upload { sub createdir { my ($r)=@_; - #FIXME 1) bad dirnames ( '/' etc) - # 2) file exists in place of dir (errormessage needs improvement) + #FIXME 1) file exists in place of dir (errormessage needs improvement) + my $newdir=&Apache::lonnet::clean_filename($ENV{'form.newdir'}); + if ($newdir eq '') { + $r->print(''. + &mt("Error: no valid directory name was provided."). + '
'); + $r->print(&done()); + return; + } my $result=&Apache::lonnet::mkdiruserfile($ENV{'user.name'}, - $ENV{'user.domain'},'portfolio'.$ENV{'form.currentpath'}.$ENV{'form.newdir'}); + $ENV{'user.domain'},'portfolio'.$ENV{'form.currentpath'}.$newdir); if ($result ne 'ok') { $r->print(' An errror occured ('.$result. ') while trying to create a new directory '.&display_file().'
');