--- loncom/publisher/lonpublisher.pm 2001/08/11 18:06:25 1.34 +++ loncom/publisher/lonpublisher.pm 2001/08/11 18:51:40 1.35 @@ -137,7 +137,20 @@ sub makeallowed { } sub urlfixup { - return shift; + my ($url,$target)=@_; + my ($host)=($url=~/(?:http\:\/\/)*([^\/]+)/); + map { + if ($_ eq $host) { + $url=~s/^http\:\/\///; + $url=~s/^$host//; + } + } values %Apache::lonnet::hostname; + $url=~s/\~$cuname/res\/$cudom\/$cuname/; + if ($target) { + $target=~s/\/[^\/]+$//; + $url=&Apache::lonnet::hreflocation($target,$url); + } + return $url; } sub publish { @@ -236,7 +249,7 @@ sub publish { map { if (defined($parms{$_})) { my $oldurl=$parms{$_}; - my $newurl=&urlfixup($oldurl); + my $newurl=&urlfixup($oldurl,$target); if ($newurl ne $oldurl) { $parms{$_}=$newurl; print $logfile 'URL: '.$tag.':'.$oldurl.' - '.