[LON-CAPA-cvs] cvs: loncom / lonenc.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 05 Oct 2007 18:33:29 -0000


albertel		Fri Oct  5 14:33:29 2007 EDT

  Modified files:              
    /loncom	lonenc.pm 
  Log:
  - BUG#5460 - don't enc javascript: etc type urls
  
  
Index: loncom/lonenc.pm
diff -u loncom/lonenc.pm:1.21 loncom/lonenc.pm:1.22
--- loncom/lonenc.pm:1.21	Fri Jul 20 15:07:25 2007
+++ loncom/lonenc.pm	Fri Oct  5 14:33:29 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # URL translation for encrypted filenames
 #
-# $Id: lonenc.pm,v 1.21 2007/07/20 19:07:25 albertel Exp $
+# $Id: lonenc.pm,v 1.22 2007/10/05 18:33:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -151,7 +151,8 @@
     my $html;
     if ($force_enc || $env{'request.enc'}) {
 	while (my ($name,$value)= each(%{ $elements })) {
-	    if (!$value) { next; }
+	    next if (!$value); 
+	    next if ($value =~ /^\w+:/); # explict javascript: or http: link
 	    my $href=&Apache::lonnet::hreflocation($Apache::lonxml::pwd[-1],$value);
 	    if ($href !~ /^http:/) {
 		# IE really wants an extension