[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm

raeburn raeburn@source.lon-capa.org
Sat, 28 Aug 2010 22:25:07 -0000


raeburn		Sat Aug 28 22:25:07 2010 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
  - rename uploaded file with cleaned filename. 
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.110 loncom/homework/essayresponse.pm:1.111
--- loncom/homework/essayresponse.pm:1.110	Mon Aug 23 03:21:26 2010
+++ loncom/homework/essayresponse.pm	Sat Aug 28 22:25:07 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.110 2010/08/23 03:21:26 raeburn Exp $
+# $Id: essayresponse.pm,v 1.111 2010/08/28 22:25:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -485,8 +485,7 @@
         push(@pathitems,$restitle);
         $path .= join('/',@pathitems);
         my $formelement = 'HWFILE'.$jspart.'_'.$id;
-        my $fname = $env{'form.'.$formelement.'.filename'};
-        &Apache::lonnet::clean_filename($fname);
+        my $fname = &Apache::lonnet::clean_filename($env{'form.'.$formelement.'.filename'});
         my $url = '/uploaded/'.$udom.'/'.$uname.'/'.$prefix.$path.'/'.$fname;
         my @stat = &Apache::lonnet::stat_file($url);
         if (@stat && $stat[0] ne 'no_such_dir') {