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

www lon-capa-cvs@mail.lon-capa.org
Sun, 08 Jun 2003 00:43:19 -0000


www		Sat Jun  7 20:43:19 2003 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  Bug #1675: single quote needs escaping in <window>
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.92 loncom/xml/scripttag.pm:1.93
--- loncom/xml/scripttag.pm:1.92	Wed Jun  4 18:30:00 2003
+++ loncom/xml/scripttag.pm	Sat Jun  7 20:43:19 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.92 2003/06/04 22:30:00 albertel Exp $
+# $Id: scripttag.pm,v 1.93 2003/06/08 00:43:19 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -288,6 +288,7 @@
     if (!$width) { $width='500'; }
     my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
     if (!$height) { $height='200'; }
+    $output =~ s/\'/\\\&\#39\;/g;
     $output =~ s/\"/\&quot\;/g;
     $result = "<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=$width,height=$height,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor=&quot;#FFFFFF&quot;> $output </body></html>\');newWindow.document.close();void(0);\">$linktext</a>";
   } elsif ($target eq 'tex') {