[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

foxr lon-capa-cvs-allow@mail.lon-capa.org
Mon, 17 Mar 2008 10:21:30 -0000


foxr		Mon Mar 17 06:21:30 2008 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  BZ4063 - Protect end_table against a </table> tag that has not 
  corresponding <table>
  
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.383 loncom/xml/londefdef.pm:1.384
--- loncom/xml/londefdef.pm:1.383	Mon Mar 10 04:54:13 2008
+++ loncom/xml/londefdef.pm	Mon Mar 17 06:21:30 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.383 2008/03/10 08:54:13 foxr Exp $
+# $Id: londefdef.pm,v 1.384 2008/03/17 10:21:30 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2101,6 +2101,10 @@
 	my $WARNING='';
         #width of columns from TeXwidth attributes
 
+	# Protect against unbalanced </table> tag.
+
+	if (scalar(@Apache::londefdef::table) > 0) {
+
 	for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
 	    for (my $jn=0;$jn<=$Apache::londefdef::table[-1]{'counter_columns'};$jn++) {
 		if ($Apache::londefdef::table[-1]{'TeXlen'}[0][$jn]<$Apache::londefdef::table[-1]{'TeXlen'}[$in][$jn]) {
@@ -2504,6 +2508,7 @@
 	    undef @Apache::londefdef::table;
 	}
     }
+    }
     return $currentstring;
 }