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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 12 Apr 2004 22:56:03 -0000


albertel		Mon Apr 12 18:56:03 2004 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - BUG#2866, Were npot doing a case insensensitve search in get_all_text_unbalanced
  - also were incorrectly allowing <loncapa_internal_turn_sylyeon/off /> need to require it to be capitalized
  - some protective \Q \E added
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.315 loncom/xml/lonxml.pm:1.316
--- loncom/xml/lonxml.pm:1.315	Wed Mar 31 00:24:00 2004
+++ loncom/xml/lonxml.pm	Mon Apr 12 18:55:59 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.315 2004/03/31 05:24:00 albertel Exp $
+# $Id: lonxml.pm,v 1.316 2004/04/12 22:55:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,26 +36,7 @@
 # The C source of the Code may not be distributed by the Licensee
 # to any other parties under any circumstances.
 #
-# last modified 06/26/00 by Alexander Sakharuk
-# 11/6 Gerd Kortemeyer
-# 6/1/1 Gerd Kortemeyer
-# 2/21,3/13 Guy
-# 3/29,5/4 Gerd Kortemeyer
-# 5/26 Gerd Kortemeyer
-# 5/27 H. K. Ng
-# 6/2,6/3,6/8,6/9 Gerd Kortemeyer
-# 6/12,6/13 H. K. Ng
-# 6/16 Gerd Kortemeyer
-# 7/27 H. K. Ng
-# 8/7,8/9,8/10,8/11,8/15,8/16,8/17,8/18,8/20,8/23,8/24 Gerd Kortemeyer
-# Guy Albertelli
-# 9/26 Gerd Kortemeyer
-# Dec Guy Albertelli
-# YEAR=2002
-# 1/1 Gerd Kortemeyer
-# 1/2 Matthew Hall
-# 1/3 Gerd Kortemeyer
-#
+
 
 package Apache::lonxml; 
 use vars 
@@ -864,7 +845,7 @@
    } elsif ($token->[0] eq 'E')  {
      $result.=$token->[2];
    }
-   if ($result =~ /(.*)\Q$tag\E(.*)/s) {
+   if ($result =~ /(.*)\Q$tag\E(.*)/is) {
      &Apache::lonxml::debug('Got a winner with leftovers ::'.$2);
      &Apache::lonxml::debug('Result is :'.$1);
      $result=$1;
@@ -926,12 +907,12 @@
 		} elsif ($token->[0] eq 'PI') {
 		    $result.=$token->[2];
 		} elsif ($token->[0] eq 'S') {
-		    if ($token->[1] =~ /^$tag$/i) { $depth++; }
-		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/i) { $Apache::lonxml::usestyle=1; }
-		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/i) { $Apache::lonxml::usestyle=0; }
+		    if ($token->[1] =~ /^\Q$tag\E$/i) { $depth++; }
+		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/) { $Apache::lonxml::usestyle=1; }
+		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/) { $Apache::lonxml::usestyle=0; }
 		    $result.=$token->[4];
 		} elsif ($token->[0] eq 'E')  {
-		    if ( $token->[1] =~ /^$tag$/i) { $depth--; }
+		    if ( $token->[1] =~ /^\Q$tag\E$/i) { $depth--; }
 		    #skip sending back the last end tag
 		    if ($depth == 0 && exists($$style{'/'.$token->[1]}) && $Apache::lonxml::usestyle) {
 			my $string=
@@ -978,13 +959,13 @@
 		} elsif ($token->[0] eq 'PI') {
 		    $result.=$token->[2];
 		} elsif ($token->[0] eq 'S') {
-		    if ( $token->[1] =~ /^$tag$/i) {
+		    if ( $token->[1] =~ /^\Q$tag\E$/i) {
 			$$pars[-1]->unget_token($token); last;
 		    } else {
 			$result.=$token->[4];
 		    }
-		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/i) { $Apache::lonxml::usestyle=1; }
-		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/i) { $Apache::lonxml::usestyle=0; }
+		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/) { $Apache::lonxml::usestyle=1; }
+		    if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/) { $Apache::lonxml::usestyle=0; }
 		} elsif ($token->[0] eq 'E')  {
 		    $result.=$token->[2];
 		}