--- loncom/lonnet/perl/lonnet.pm 2003/12/12 00:20:08 1.459 +++ loncom/lonnet/perl/lonnet.pm 2004/01/12 19:53:54 1.460 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.459 2003/12/12 00:20:08 albertel Exp $ +# $Id: lonnet.pm,v 1.460 2004/01/12 19:53:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4441,13 +4441,15 @@ sub filelocation { sub hreflocation { my ($dir,$file)=@_; - unless (($file=~/^http:\/\//i) || ($file=~/^\//)) { - my $finalpath=filelocation($dir,$file); - $finalpath=~s/^\/home\/httpd\/html//; - $finalpath=~s-/home/(\w+)/public_html/-/~$1/-; - return $finalpath; - } else { - return $file; + unless (($file=~m-^http://-i) || ($file=~m-^/-)) { + my $finalpath=filelocation($dir,$file); + $finalpath=~s-^/home/httpd/html--; + $finalpath=~s-/home/(\w+)/public_html/-/~$1/-; + return $finalpath; + } elsif ($file=~m-^/home-) { + $file=~s-^/home/httpd/html--; + $file=~s-/home/(\w+)/public_html/-/~$1/-; + return $file; } }