Diff for /loncom/interface/lonfeedback.pm between versions 1.193 and 1.194

version 1.193, 2006/04/18 22:56:16 version 1.194, 2006/04/23 03:50:54
Line 2326  sub resource_output { Line 2326  sub resource_output {
 }  }
   
 sub clear_out_html {  sub clear_out_html {
   my ($message,$override)=@_;    my ($message,$override,$ignore_htmlarea)=@_;
   unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }    if (!$ignore_htmlarea
         && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
 # Always allow the <m>-tag  # Always allow the <m>-tag
   my %html=(M=>1);    my %html=(M=>1);
 # Check if more is allowed  # Check if more is allowed
Line 2343  sub clear_out_html { Line 2344  sub clear_out_html {
      H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);       H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
   }    }
 # Do the substitution of everything that is not explicitly allowed  # Do the substitution of everything that is not explicitly allowed
   $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/    $message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/
   {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;    {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;
   $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/    $message =~ s/(\<?\s*(\w*)[^\<\>]*)\>/
   {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;    {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;
   return $message;    return $message;
 }  }
Line 2614  sub show_preview { Line 2615  sub show_preview {
     &newline_to_br(\$message);      &newline_to_br(\$message);
     $message=&Apache::lonspeller::markeduptext($message);      $message=&Apache::lonspeller::markeduptext($message);
     $message=&Apache::lontexconvert::msgtexconverted($message);      $message=&Apache::lontexconvert::msgtexconverted($message);
     my $subject=&clear_out_html($env{'form.subject'});      my $subject=&clear_out_html($env{'form.subject'},undef,1);
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
     my $start_page=      my $start_page=
Line 2668  ENDPREVIEW Line 2669  ENDPREVIEW
 sub modify_attachments {  sub modify_attachments {
     my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;      my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
     my $orig_subject = &Apache::lonnet::unescape($env{'form.subject'});      my $orig_subject = &Apache::lonnet::unescape($env{'form.subject'});
     my $subject=&clear_out_html($orig_subject);      my $subject=&clear_out_html($orig_subject,undef,1);
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
     my $timestamp=$env{'form.timestamp'};      my $timestamp=$env{'form.timestamp'};
Line 3411  ENDREDIR Line 3412  ENDREDIR
       my ($typestyle,%to) = &decide_receiver($feedurl);        my ($typestyle,%to) = &decide_receiver($feedurl);
   
 # Actually send mail  # Actually send mail
       my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),$feedurl,$email,$citations,        my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'},
         undef,1),
         $feedurl,$email,$citations,
       $attachmenturl,%to);        $attachmenturl,%to);
   
 # Discussion? Store that.  # Discussion? Store that.
   
       my $numpost=0;        my $numpost=0;
       if ($env{'form.discuss'} || $env{'form.anondiscuss'}) {        if ($env{'form.discuss'} || $env{'form.anondiscuss'}) {
   my $subject = &clear_out_html($env{'form.subject'});    my $subject = &clear_out_html($env{'form.subject'},undef,1);
   my $anonmode=(defined($env{'form.anondiscuss'}));    my $anonmode=(defined($env{'form.anondiscuss'}));
   $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,    $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
   $subject);    $subject);
Line 3429  ENDREDIR Line 3432  ENDREDIR
   
       my $blog='';        my $blog='';
       if ($env{'form.blog'}) {        if ($env{'form.blog'}) {
   my $subject = &clear_out_html($env{'form.subject'});    my $subject = &clear_out_html($env{'form.subject'},undef,1);
   $status.=&Apache::lonrss::addentry($env{'user.name'},    $status.=&Apache::lonrss::addentry($env{'user.name'},
     $env{'user.domain'},      $env{'user.domain'},
     'CourseBlog_'.$env{'request.course.id'},      'CourseBlog_'.$env{'request.course.id'},

Removed from v.1.193  
changed lines
  Added in v.1.194


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