[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 21 Feb 2007 21:01:59 -0000


albertel		Wed Feb 21 16:01:59 2007 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - BUG#5207
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.219 loncom/publisher/lonpublisher.pm:1.220
--- loncom/publisher/lonpublisher.pm:1.219	Wed Jan 31 21:38:05 2007
+++ loncom/publisher/lonpublisher.pm	Wed Feb 21 16:01:59 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.219 2007/02/01 02:38:05 albertel Exp $
+# $Id: lonpublisher.pm,v 1.220 2007/02/21 21:01:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -409,14 +409,14 @@
     if ($url =~ /^mailto:/i) { return $url; }
     #internal document links need no fixing
     if ($url =~ /^\#/) { return $url; } 
-    my ($host)=($url=~/(?:http\:\/\/)*([^\/]+)/);
+    my ($host)=($url=~/(?:(?:http|https|ftp)\:\/\/)*([^\/]+)/);
     foreach (values %Apache::lonnet::hostname) {
 	if ($_ eq $host) {
-	    $url=~s/^http\:\/\///;
+	    $url=~s/^(?:http|https|ftp)\:\/\///;
             $url=~s/^$host//;
         }
     }
-    if ($url=~/^http\:\/\//) { return $url; }
+    if ($url=~/^(?:http|https|ftp)\:\/\//) { return $url; }
     $url=~s/\~$cuname/res\/$cudom\/$cuname/;
     return $url;
 }
@@ -468,7 +468,7 @@
     }
     if (($newurl !~ /^javascript:/i) &&
 	($newurl !~ /^mailto:/i) &&
-	($newurl !~ /^http:/i) &&
+	($newurl !~ /^(?:http|https|ftp):/i) &&
 	($newurl !~ /^\#/)) {
 	$$allow{&absoluteurl($newurl,$target)}=1;
     }