--- loncom/publisher/lonpublisher.pm 2007/02/01 02:38:05 1.219 +++ loncom/publisher/lonpublisher.pm 2007/05/02 01:34:23 1.224 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.219 2007/02/01 02:38:05 albertel Exp $ +# $Id: lonpublisher.pm,v 1.224 2007/05/02 01:34:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -409,15 +409,14 @@ sub urlfixup { if ($url =~ /^mailto:/i) { return $url; } #internal document links need no fixing if ($url =~ /^\#/) { return $url; } - my ($host)=($url=~/(?:http\:\/\/)*([^\/]+)/); - foreach (values %Apache::lonnet::hostname) { - if ($_ eq $host) { - $url=~s/^http\:\/\///; - $url=~s/^$host//; - } + 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\:\/\//) { return $url; } - $url=~s/\~$cuname/res\/$cudom\/$cuname/; + if ($url=~m{^(?:http|https|ftp)://}) { return $url; } + $url=~s{\Q~$cuname\E}{res/$cudom/$cuname}; return $url; } @@ -468,7 +467,7 @@ sub set_allow { } if (($newurl !~ /^javascript:/i) && ($newurl !~ /^mailto:/i) && - ($newurl !~ /^http:/i) && + ($newurl !~ /^(?:http|https|ftp):/i) && ($newurl !~ /^\#/)) { $$allow{&absoluteurl($newurl,$target)}=1; } @@ -845,7 +844,7 @@ sub store_metadata { \%metadata); } if (defined($status) && $status ne '') { - $error='Error occured storing new values in '. + $error='Error occured saving new values in '. 'metadata table in LON-CAPA database'; &Apache::lonnet::logthis($error); &Apache::lonnet::logthis($status); @@ -1105,7 +1104,7 @@ sub publish { } } if ($chparms) { - $scrout.='

'.&mt('New parameters or stored values'). + $scrout.='

'.&mt('New parameters or saved values'). ': '.$chparms.'

'; } @@ -1122,7 +1121,7 @@ sub publish { } } if ($chparms) { - $scrout.='

'.&mt('Obsolete parameters or stored values').': '. + $scrout.='

'.&mt('Obsolete parameters or saved values').': '. $chparms.'

'.&mt('Warning!'). '

'. &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'


';