[LON-CAPA-cvs] cvs: loncom / lonenc.pm
raeburn
raeburn at source.lon-capa.org
Fri Sep 30 11:58:05 EDT 2011
raeburn Fri Sep 30 15:58:05 2011 EDT
Modified files:
/loncom lonenc.pm
Log:
- Only add extension if &encrypted() returned an encryted URL.
Index: loncom/lonenc.pm
diff -u loncom/lonenc.pm:1.24 loncom/lonenc.pm:1.25
--- loncom/lonenc.pm:1.24 Fri Dec 19 14:29:13 2008
+++ loncom/lonenc.pm Fri Sep 30 15:58:05 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network
# URL translation for encrypted filenames
#
-# $Id: lonenc.pm,v 1.24 2008/12/19 14:29:13 raeburn Exp $
+# $Id: lonenc.pm,v 1.25 2011/09/30 15:58:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -168,8 +168,10 @@
if ($href !~ /^https?\:/) {
# IE really wants an extension
my ($extension) = ($href =~ m/(\.[^.]*)$/);
- $href = &Apache::lonenc::encrypted($href,$force_enc);
- $href .= $extension;
+ my $newhref = &Apache::lonenc::encrypted($href,$force_enc);
+ unless ($newhref eq $href) {
+ $href = $newhref.$extension;
+ }
}
$token->[2]->{$name}=$href;
}
More information about the LON-CAPA-cvs
mailing list