--- loncom/publisher/lonpublisher.pm 2014/01/15 18:49:56 1.289 +++ loncom/publisher/lonpublisher.pm 2014/07/27 11:14:36 1.290 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.289 2014/01/15 18:49:56 bisitz Exp $ +# $Id: lonpublisher.pm,v 1.290 2014/07/27 11:14:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -468,7 +468,7 @@ Currently undocumented ######################################### ######################################### sub set_allow { - my ($allow,$logfile,$target,$tag,$oldurl)=@_; + my ($allow,$logfile,$target,$tag,$oldurl,$type)=@_; my $newurl=&urlfixup($oldurl,$target); my $return_url=$oldurl; print $logfile 'GUYURL: '.$tag.':'.$oldurl.' - '.$newurl."\n"; @@ -480,6 +480,11 @@ sub set_allow { ($newurl !~ /^mailto:/i) && ($newurl !~ /^(?:http|https|ftp):/i) && ($newurl !~ /^\#/)) { + if (($type eq 'src') || ($type eq 'href')) { + if ($newurl =~ /^([^?]+)\?[^?]*$/) { + $newurl = $1; + } + } $$allow{&absoluteurl($newurl,$target)}=1; } return $return_url; @@ -723,7 +728,7 @@ sub fix_ids_and_indices { if ($key =~ /^$type$/i) { $parms{$key}=&set_allow(\%allow,$logfile, $target,$tag, - $parms{$key}); + $parms{$key},$type); } } } @@ -836,7 +841,7 @@ sub fix_ids_and_indices { } } } - $outstring .= $script + $outstring .= $script; } } } elsif ($token->[0] eq 'E') {