Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.314 and 1.315

version 1.314, 2003/01/09 22:45:51 version 1.315, 2003/01/10 14:50:08
Line 857  sub tokenwrapper { Line 857  sub tokenwrapper {
 sub userfileupload {  sub userfileupload {
     my ($formname,$coursedoc)=@_;      my ($formname,$coursedoc)=@_;
     my $fname=$ENV{'form.'.$formname.'.filename'};      my $fname=$ENV{'form.'.$formname.'.filename'};
   # Replace Windows backslashes by forward slashes
     $fname=~s/\\/\//g;      $fname=~s/\\/\//g;
   # Get rid of everything but the actual filename
     $fname=~s/^.*\/([^\/]+)$/$1/;      $fname=~s/^.*\/([^\/]+)$/$1/;
   # Replace spaces by underscores
       $fname=~s/\s+/\_/g;
   # Replace all other weird characters by nothing
       $fname=~s/[^\w\.]//g;
   # See if there is anything left
     unless ($fname) { return 'error: no uploaded file'; }      unless ($fname) { return 'error: no uploaded file'; }
     chop($ENV{'form.'.$formname});      chop($ENV{'form.'.$formname});
 # Create the directory if not present  # Create the directory if not present

Removed from v.1.314  
changed lines
  Added in v.1.315


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