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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 06 Mar 2002 22:58:46 -0000


albertel		Wed Mar  6 17:58:46 2002 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - <allow> tags shouldn't be generated for non absolute or relative (internal) hrefs
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.73 loncom/publisher/lonpublisher.pm:1.74
--- loncom/publisher/lonpublisher.pm:1.73	Thu Feb 14 17:01:39 2002
+++ loncom/publisher/lonpublisher.pm	Wed Mar  6 17:58:45 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.73 2002/02/14 22:01:39 albertel Exp $
+# $Id: lonpublisher.pm,v 1.74 2002/03/06 22:58:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -326,7 +326,12 @@
 				  print $logfile 'URL: '.$tag.':'.$oldurl.' - '.
 				      $newurl."\n";
 			      }
-			      $allow{&absoluteurl($newurl,$target)}=1;
+			      if (($newurl !~ /^javascript:/i) &&
+				  ($newurl !~ /^mailto:/i) &&
+				  ($newurl !~ /^http:/i) &&
+				  ($newurl !~ /^\#/)) {
+				  $allow{&absoluteurl($newurl,$target)}=1;
+			      }
 			  }
 			  last;
 		      }