--- loncom/publisher/loncfile.pm 2003/08/01 18:06:33 1.34 +++ loncom/publisher/loncfile.pm 2003/08/01 20:32:05 1.35 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.34 2003/08/01 18:06:33 www Exp $ +# $Id: loncfile.pm,v 1.35 2003/08/01 20:32:05 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -173,8 +173,9 @@ Global References sub URLToPath { my $Url = shift; &Debug($r, "UrlToPath got: $Url"); - $Url=~ s/^http\:\/\/[^\/]+\/\~(\w+)/\/home\/$1\/public_html/; $Url=~ s/^http\:\/\/[^\/]+//; + $Url=~ s/^\///; + $Url=~ s/(\~|priv\/)(\w+)\//\/home\/$2\/public_html\//; &Debug($r, "Returning $Url \n"); return $Url; } @@ -1241,12 +1242,7 @@ sub handler { if ($ENV{'form.filename'}) { $fn=&Apache::lonnet::unescape($ENV{'form.filename'}); - &Debug($r, "loncfile::handler - raw url: $fn"); -# $fn=~s/^http\:\/\/[^\/]+\/\~(\w+)/\/home\/$1\/public_html/; -# $fn=~s/^http\:\/\/[^\/]+//; - $fn=URLToPath($fn); - &Debug($r, "loncfile::handler - doctored url: $fn"); - + $fn=&URLToPath($fn); } else { &Debug($r, "loncfile::handler - no form.filename"); $r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}.