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

raeburn raeburn@source.lon-capa.org
Fri, 13 Mar 2009 00:34:20 -0000


raeburn		Fri Mar 13 00:34:20 2009 EDT

  Modified files:              
    /loncom/homework	response.pm 
  Log:
  - Protect against the effects of using partIDs and responseIDs which contain characters with special meanings in perl regexps.
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.211 loncom/homework/response.pm:1.212
--- loncom/homework/response.pm:1.211	Fri Mar  6 16:13:29 2009
+++ loncom/homework/response.pm	Fri Mar 13 00:34:20 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.211 2009/03/06 16:13:29 raeburn Exp $
+# $Id: response.pm,v 1.212 2009/03/13 00:34:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -283,7 +283,7 @@
     my %previous;
     $previous{'used'} = 0;
     foreach my $key (sort(keys(%Apache::lonhomework::history))) {
-	if ($key =~ /resource\.$partid\.$id\.submission$/) {
+	if ($key =~ /resource\.\Q$partid\E\.\Q$id\E\.submission$/) {
 	    if ( $last && $key =~ /^(\d+):/ ) {
 		next if ($1 >= $last);
 	    }