--- loncom/interface/lonfeedback.pm 2002/10/28 14:00:18 1.36 +++ loncom/interface/lonfeedback.pm 2002/10/28 23:28:52 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.36 2002/10/28 14:00:18 www Exp $ +# $Id: lonfeedback.pm,v 1.37 2002/10/28 23:28:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -227,9 +227,22 @@ sub resource_output { sub clear_out_html { my $message=$ENV{'form.comment'}; - $message=~s/\<\/*m\s*\>//g; - $message=~s/\/\>\;/g; + my $cid=$ENV{'request.course.id'}; + if ($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) { + # allows


      • + #
        + my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, + BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1); + + $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ + {($html{uc($2)}&(length($1)<1000))?"\<$1":"\<$1"}/ge; + $message =~ s/(\]*)\>/ + {($html{uc($2)}&(length($1)<1000))?"$1\>":"$1\>"}/ge; + } else { + $message=~s/\<\/*m\s*\>//g; + $message=~s/\/\>\;/g; + } return $message; }