--- loncom/publisher/lonpublisher.pm 2007/02/21 21:01:59 1.220 +++ loncom/publisher/lonpublisher.pm 2007/03/02 23:18:19 1.221 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.220 2007/02/21 21:01:59 albertel Exp $ +# $Id: lonpublisher.pm,v 1.221 2007/03/02 23:18:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -410,10 +410,11 @@ sub urlfixup { #internal document links need no fixing if ($url =~ /^\#/) { return $url; } my ($host)=($url=~/(?:(?:http|https|ftp)\:\/\/)*([^\/]+)/); - foreach (values %Apache::lonnet::hostname) { - if ($_ eq $host) { + my %all_hostnames = &Apache::lonnet::all_hostnames(); + foreach my $hostname (values(%all_hostnames)) { + if ($hostname eq $host) { $url=~s/^(?:http|https|ftp)\:\/\///; - $url=~s/^$host//; + $url=~s/^\Q$host\E//; } } if ($url=~/^(?:http|https|ftp)\:\/\//) { return $url; }