--- loncom/publisher/loncfile.pm 2007/07/25 19:56:57 1.86 +++ loncom/publisher/loncfile.pm 2007/10/18 21:58:21 1.87 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.86 2007/07/25 19:56:57 albertel Exp $ +# $Id: loncfile.pm,v 1.87 2007/10/18 21:58:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -165,7 +165,7 @@ sub url { sub display { my $fn=shift; $fn=~s-^/home/($match_username)/public_html-/priv/$1-; - return ''.$fn.''; + return ''.$fn.''; } @@ -341,6 +341,7 @@ sub cleanDest { $foundbad=1; $dest=~s/\.//g; } + $dest =~ s/(\s+$|^\s+)//g; if ($dest=~/[\#\?&%\":]/) { $foundbad=1; $dest=~s/[\#\?&%\":]//g; @@ -349,13 +350,13 @@ sub cleanDest { my ($newpath)=($dest=~m|(.*)/|); $newpath=&relativeDest($fn,$newpath,$uname); if (! -d "$newpath") { - $request->print("
".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"'.$newpath.'"')."
"); + $request->print("".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"'.&display($newpath).'"')."
"); $dest=~s|.*/||; } } if ($dest =~ /\.(\d+)\.(\w+)$/){ $request->print('' - .&mt('Bad filename [_1].'.$action.' '.&display($fn).
- '
to '.&display($newfilename).'?
'.&mt('No new filename specified.').'
');