--- loncom/publisher/lonretrieve.pm 2010/12/14 16:26:04 1.42 +++ loncom/publisher/lonretrieve.pm 2011/11/14 00:20:31 1.47 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to retrieve an old version of a file # -# $Id: lonretrieve.pm,v 1.42 2010/12/14 16:26:04 www Exp $ +# $Id: lonretrieve.pm,v 1.47 2011/11/14 00:20:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,20 +108,18 @@ use LONCAPA(); # ------------------------------------ Interface for selecting previous version sub phaseone { my ($r,$fn,$uname,$udom)=@_; - my $docroot=$r->dir_config('lonDocRoot'); - my $urldir='/res/'.$udom.'/'.$uname.$fn; - $urldir=~s/\/[^\/]+$/\//; + my $urldir = "/res/$udom/$uname".$fn; + my $resfn = $r->dir_config('lonDocRoot').$urldir; - my $resfn=$docroot.'/res/'.$udom.'/'.$uname.$fn; - my $resdir=$resfn; - $resdir=~s/\/[^\/]+$/\//; + $urldir =~ s{[^/]+$}{}; + my $resdir = $r->dir_config('lonDocRoot').$urldir; my ($main,$suffix,$is_meta) = &get_file_info($fn); if (-e $resfn) { $r->print('