Diff for /loncom/interface/lonfeedback.pm between versions 1.36 and 1.37

version 1.36, 2002/10/28 14:00:18 version 1.37, 2002/10/28 23:28:52
Line 227  sub resource_output { Line 227  sub resource_output {
   
 sub clear_out_html {  sub clear_out_html {
   my $message=$ENV{'form.comment'};    my $message=$ENV{'form.comment'};
   $message=~s/\<\/*m\s*\>//g;    my $cid=$ENV{'request.course.id'};
   $message=~s/\</\&lt\;/g;    if ($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) {
   $message=~s/\>/\&gt\;/g;        # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> 
         # <BLOCKQUOTE> <DIV .*> <DIV> <IMG>
         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":"\&lt;$1"}/ge;
         $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/
     {($html{uc($2)}&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;
     } else {
         $message=~s/\<\/*m\s*\>//g;
         $message=~s/\</\&lt\;/g;
         $message=~s/\>/\&gt\;/g;
     }
   return $message;    return $message;
 }  }
   

Removed from v.1.36  
changed lines
  Added in v.1.37


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>