--- loncom/lonnet/perl/lonnet.pm 2007/12/05 20:06:34 1.929 +++ loncom/lonnet/perl/lonnet.pm 2007/12/05 20:08:52 1.930 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.929 2007/12/05 20:06:34 albertel Exp $ +# $Id: lonnet.pm,v 1.930 2007/12/05 20:08:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1635,7 +1635,7 @@ sub ssi_body { &ssi($filelink,%form)); $output=~s|//(\s*)?\s||gs; $output=~s/^.*?\]*\>//si; - $output=~s/(.*)\<\/body\s*\>.*?$/$1/si; + $output=~s/\<\/body\s*\>.*?$//si; return $output; } @@ -7973,7 +7973,13 @@ sub filelocation { } } $location=~s://+:/:g; # remove duplicate / - while ($location=~m:/\.\./:) {$location=~ s:/[^/]+/\.\./:/:g;} #remove dir/.. + while ($location=~m{/\.\./}) { + if ($location =~ m{/[^/]+/\.\./}) { + $location=~ s{/[^/]+/\.\./}{/}g; + } else { + $location=~ s{/\.\./}{/}g; + } + } #remove dir/.. while ($location=~m:/\./:) {$location=~ s:/\./:/:g;} #remove /./ return $location; }