--- loncom/lonenc.pm 2006/05/30 19:47:28 1.16 +++ loncom/lonenc.pm 2006/09/28 20:47:13 1.17 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for encrypted filenames # -# $Id: lonenc.pm,v 1.16 2006/05/30 19:47:28 www Exp $ +# $Id: lonenc.pm,v 1.17 2006/09/28 20:47:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,6 +46,8 @@ sub unencrypted { my $uri=shift; $uri=~s/^\/enc\/(\d+)\///; my $cmdlength=$1; + # strip any added extension + $uri=~s/\.[^.]*//; my $seed=&encryptseed(); unless ($seed) { return '/'.$uri; @@ -129,7 +131,10 @@ sub encrypt_ref { if (!$value) { next; } my $href=&Apache::lonnet::hreflocation($Apache::lonxml::pwd[-1],$value); if ($href !~ /^http:/) { + # IE really wants an extension + my ($extension) = ($href =~ m/(\.[^.]*)$/); $href = &Apache::lonenc::encrypted($href,$force_enc); + $href .= $extension; } $token->[2]->{$name}=$href; }