--- loncom/xml/lonxml.pm 2002/03/08 18:32:55 1.156 +++ loncom/xml/lonxml.pm 2002/03/14 20:30:36 1.157 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.156 2002/03/08 18:32:55 matthew Exp $ +# $Id: lonxml.pm,v 1.157 2002/03/14 20:30:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,7 @@ qw(@pwd @outputstack $redirection $impor use strict; use HTML::TokeParser; use HTML::TreeBuilder; +use HTML::Entities; use Safe; use Safe::Hole; use Math::Cephes qw(:trigs :hypers :bessels erf erfc); @@ -1087,7 +1088,7 @@ SIMPLECONTENT sub inserteditinfo { my ($result,$filecontents)=@_; - $filecontents =~ s::</textarea>:ig; + $filecontents = &HTML::Entities::encode($filecontents); # my $editheader='Edit below
'; my $editfooter=(< @@ -1250,6 +1251,7 @@ sub get_param { if ( ! $context ) { $context = -1; } my $args =''; if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; } + if ( ! $args ) { return undef; } if ( $args =~ /my \$$param=\"/ ) { return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #' } else {