Diff for /loncom/publisher/loncfile.pm between versions 1.57 and 1.58

version 1.57, 2004/06/10 18:20:16 version 1.58, 2004/07/02 08:07:17
Line 289  sub checksuffix { Line 289  sub checksuffix {
 }  }
   
 sub cleanDest {  sub cleanDest {
     my ($request,$dest)=@_;      my ($request,$dest,$subdir)=@_;
     #remove bad characters      #remove bad characters
       my $foundbad=0;
       if ($subdir && $dest =~/\./) {
    $foundbad=1;
    $dest=~s/\.//g;
       }
     if  ($dest=~/[\#\?&%\"]/) {      if  ($dest=~/[\#\?&%\"]/) {
  $request->print("<p><font color=\"red\">".&mt('Invalid characters in requested name have been removed.')."</font></p>");   $foundbad=1;
  $dest=~s/[\#\?&%]//g;   $dest=~s/[\#\?&%]//g;
     }      }
       if ($foundbad) {
    $request->print("<p><font color=\"red\">".&mt('Invalid characters in requested name have been removed.')."</font></p>");
       }
     return $dest;      return $dest;
 }  }
   
Line 750  performed and reported to the user. Line 758  performed and reported to the user.
 sub phaseone {  sub phaseone {
     my ($r,$fn,$uname,$udom)=@_;      my ($r,$fn,$uname,$udom)=@_;
       
     my $newfilename=&cleanDest($r,$ENV{'form.newfilename'});      my $doingdir=0;
       if ($ENV{'form.action'} eq 'newdir') { $doingdir=1; }
       my $newfilename=&cleanDest($r,$ENV{'form.newfilename'},$doingdir);
     $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.'" />'.

Removed from v.1.57  
changed lines
  Added in v.1.58


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>