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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 10 Apr 2002 15:21:29 -0000


albertel		Wed Apr 10 11:21:29 2002 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - more inteligent way to protect entites (might address BUG#228 needs testing)
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.69 loncom/xml/scripttag.pm:1.70
--- loncom/xml/scripttag.pm:1.69	Thu Mar 28 17:02:27 2002
+++ loncom/xml/scripttag.pm	Wed Apr 10 11:21:29 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.69 2002/03/28 22:02:27 albertel Exp $
+# $Id: scripttag.pm,v 1.70 2002/04/10 15:21:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,13 +62,7 @@
       if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) {
 	$Apache::lonxml::evaluate--;
 	$result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor=&quot;#FFFFFF&quot;><pre>";
-	my $listing= &Apache::run::dump($target,$safeeval);
-	$listing =~ s/\n/\\n/g;
-	$listing =~ s/\"/&quot;/g;
-	$listing =~ s/\'/&rsquo;/g;
-	$listing =~ s/</&lt;/g;
-	$listing =~ s/>/&gt;/g;
-	$listing =~ s/&/&amp;/g;
+	my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval));
 	$result.=$listing;
 	$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />";
       }