Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.58 and 1.59

version 1.58, 2000/11/02 17:42:09 version 1.59, 2000/11/07 17:20:10
Line 1418  sub filelocation { Line 1418  sub filelocation {
   my ($dir,$file) = @_;    my ($dir,$file) = @_;
   my $location;    my $location;
   $file=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces    $file=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces
   $file=~s/^$perlvar{'lonDocRoot'}//;    if ($file=~m:^/~:) { # is a contruction space reference
   $file=~s:^/*res::;      $location = $file;
   if ( !( $file =~ m:^/:) ) {      $location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:;
     $location = $dir. '/'.$file;  
   } else {    } else {
     $location = '/home/httpd/html/res'.$file;      $file=~s/^$perlvar{'lonDocRoot'}//;
       $file=~s:^/*res::;
       if ( !( $file =~ m:^/:) ) {
         $location = $dir. '/'.$file;
       } else {
         $location = '/home/httpd/html/res'.$file;
       }
   }    }
   $location=~s://+:/:g; # remove duplicate /    $location=~s://+:/:g; # remove duplicate /
   while ($location=~m:/\.\./:) {$location=~ s:/[^/]+/\.\./:/:g;} #remove dir/..    while ($location=~m:/\.\./:) {$location=~ s:/[^/]+/\.\./:/:g;} #remove dir/..

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


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