[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 17 Apr 2007 23:21:09 -0000
albertel Tue Apr 17 19:21:09 2007 EDT
Modified files:
/loncom/publisher lonpublisher.pm
Log:
- remove an all_hostnames call
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.222 loncom/publisher/lonpublisher.pm:1.223
--- loncom/publisher/lonpublisher.pm:1.222 Fri Mar 2 18:20:17 2007
+++ loncom/publisher/lonpublisher.pm Tue Apr 17 19:21:06 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.222 2007/03/02 23:20:17 albertel Exp $
+# $Id: lonpublisher.pm,v 1.223 2007/04/17 23:21:06 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -409,15 +409,13 @@
if ($url =~ /^mailto:/i) { return $url; }
#internal document links need no fixing
if ($url =~ /^\#/) { return $url; }
- my ($host)=($url=~/(?:(?:http|https|ftp)\:\/\/)*([^\/]+)/);
- my %all_hostnames = &Apache::lonnet::all_hostnames();
- foreach my $hostname (values(%all_hostnames)) {
- if ($hostname eq $host) {
- $url=~s/^(?:http|https|ftp)\:\/\///;
- $url=~s/^\Q$host\E//;
- }
+ my ($host)=($url=~m{(?:(?:http|https|ftp)://)*([^/]+)});
+ my @lonids = &Apache::lonnet::machine_ids($host);
+ if (@lonids) {
+ $url=~s{^(?:http|https|ftp)://}{};
+ $url=~s/^\Q$host\E//;
}
- if ($url=~/^(?:http|https|ftp)\:\/\//) { return $url; }
+ if ($url=~m{^(?:http|https|ftp)://}) { return $url; }
$url=~s{\Q~$cuname\E}{res/$cudom/$cuname};
return $url;
}