--- loncom/publisher/lonpublisher.pm 2002/01/18 16:48:14 1.72 +++ loncom/publisher/lonpublisher.pm 2002/04/17 16:21:46 1.78 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.72 2002/01/18 16:48:14 albertel Exp $ +# $Id: lonpublisher.pm,v 1.78 2002/04/17 16:21:46 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -68,7 +68,7 @@ use strict; use Apache::File; use File::Copy; use Apache::Constants qw(:common :http :methods); -use HTML::TokeParser; +use HTML::LCParser; use Apache::lonxml; use Apache::lonhomework; use Apache::loncacc; @@ -91,7 +91,7 @@ my $cudom; sub metaeval { my $metastring=shift; - my $parser=HTML::TokeParser->new(\$metastring); + my $parser=HTML::LCParser->new(\$metastring); my $token; while ($token=$parser->get_token) { if ($token->[0] eq 'S') { @@ -257,7 +257,7 @@ sub publish { $content=join('',<$org>); } { - my $parser=HTML::TokeParser->new(\$content); + my $parser=HTML::LCParser->new(\$content); my $token; while ($token=$parser->get_token) { if ($token->[0] eq 'S') { @@ -288,7 +288,7 @@ sub publish { "Max Index: $maxindex (min 10)\n"; } my $outstring=''; - my $parser=HTML::TokeParser->new(\$content); + my $parser=HTML::LCParser->new(\$content); $parser->xml_mode(1); my $token; while ($token=$parser->get_token) { @@ -326,7 +326,12 @@ sub publish { 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; } @@ -392,8 +397,9 @@ sub publish { $scrout.='