Diff for /loncom/publisher/loncfile.pm between versions 1.86 and 1.87

version 1.86, 2007/07/25 19:56:57 version 1.87, 2007/10/18 21:58:21
Line 165  sub url { Line 165  sub url {
 sub display {  sub display {
     my $fn=shift;      my $fn=shift;
     $fn=~s-^/home/($match_username)/public_html-/priv/$1-;      $fn=~s-^/home/($match_username)/public_html-/priv/$1-;
     return '<tt>'.$fn.'</tt>';      return '<span class="LC_filename">'.$fn.'</span>';
 }  }
   
   
Line 341  sub cleanDest { Line 341  sub cleanDest {
  $foundbad=1;   $foundbad=1;
  $dest=~s/\.//g;   $dest=~s/\.//g;
     }      }
       $dest =~ s/(\s+$|^\s+)//g;
     if  ($dest=~/[\#\?&%\":]/) {      if  ($dest=~/[\#\?&%\":]/) {
  $foundbad=1;   $foundbad=1;
  $dest=~s/[\#\?&%\":]//g;   $dest=~s/[\#\?&%\":]//g;
Line 349  sub cleanDest { Line 350  sub cleanDest {
  my ($newpath)=($dest=~m|(.*)/|);   my ($newpath)=($dest=~m|(.*)/|);
  $newpath=&relativeDest($fn,$newpath,$uname);   $newpath=&relativeDest($fn,$newpath,$uname);
  if (! -d "$newpath") {   if (! -d "$newpath") {
     $request->print("<p><span class=\"LC_error\">".&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>"')."</span></p>");      $request->print("<p><span class=\"LC_error\">".&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.','"'.&display($newpath).'"')."</span></p>");
     $dest=~s|.*/||;      $dest=~s|.*/||;
  }   }
     }      }
     if ($dest =~ /\.(\d+)\.(\w+)$/){      if ($dest =~ /\.(\d+)\.(\w+)$/){
  $request->print('<span class="LC_error">'   $request->print('<span class="LC_error">'
  .&mt('Bad filename [_1].<br /> <tt>(name).(number).(extension)</tt> not allowed. <br /> Removing the <tt>.number.</tt> from requested filename.',$dest)   .&mt('Bad filename [_1].<br /> <tt>(name).(number).(extension)</tt> not allowed. <br /> Removing the <tt>.number.</tt> from requested filename.',&display($dest))
  .'</span>');   .'</span>');
  $dest =~ s/\.(\d+)(\.\w+)$/$2/;   $dest =~ s/\.(\d+)(\.\w+)$/$2/;
     }      }
Line 527  sub Rename1 { Line 528  sub Rename1 {
     $request->print('<input type="hidden" name="newfilename" value="'.      $request->print('<input type="hidden" name="newfilename" value="'.
     $newfilename.      $newfilename.
     '" /><p>'.$action.' '.&display($fn).      '" /><p>'.$action.' '.&display($fn).
     '</tt><br />to '.&display($newfilename).'?</p>');      '</p><br />to '.&display($newfilename).'?</p>');
     &CloseForm1($request, $fn);      &CloseForm1($request, $fn);
  } else {   } else {
     $request->print('<p>'.&mt('No new filename specified.').'</p></form>');      $request->print('<p>'.&mt('No new filename specified.').'</p></form>');

Removed from v.1.86  
changed lines
  Added in v.1.87


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