--- loncom/publisher/loncfile.pm 2003/06/19 20:49:13 1.31 +++ loncom/publisher/loncfile.pm 2003/06/19 21:04:37 1.32 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.31 2003/06/19 20:49:13 albertel Exp $ +# $Id: loncfile.pm,v 1.32 2003/06/19 21:04:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -387,6 +387,17 @@ sub checksuffix { } return $result; } + +sub cleanDest { + my ($request,$dest)=@_; + #remove bad characters + if ($dest=~/[\#\?&]/) { + $request->print("

Invalid characters in requested name have been removed.

"); + $dest=~s/[\#\?&]//g; + } + return $dest; +} + =pod =item CloseForm1($request, $user, $file) @@ -778,12 +789,6 @@ sub NewFile1 { } } - #remove bad characters - if ($newfilename=~/[\#\?&]/) { - $request->print("

Invalid characters in requested filename have been removed.

"); - $newfilename=~s/[\#\?&]//g; - } - my $fullpath = $dir.'/'.$newfilename; &Debug($request, "Full path is : ".$fullpath); @@ -842,7 +847,8 @@ sub phaseone { # my $conspace=ConstructionPathFromRelative($uname, $fn); - + $ENV{'form.newfilename'}=&cleanDest($r,$ENV{'form.newfilename'}); + $r->print('
'. ''. ''.