Diff for /loncom/interface/lonfeedback.pm between versions 1.285 and 1.286

version 1.285, 2010/01/24 15:30:04 version 1.286, 2010/01/24 19:58:24
Line 1396  sub get_post_contents { Line 1396  sub get_post_contents {
         my ($timesent,$attachmsg);          my ($timesent,$attachmsg);
         my %currattach = ();          my %currattach = ();
         $timesent = &Apache::lonlocal::locallocaltime($postversions[$i]);          $timesent = &Apache::lonlocal::locallocaltime($postversions[$i]);
  &newline_to_br(\$messages->{$i});          unless (&contains_block_html($messages->{$i})) {
               &newline_to_br(\$messages->{$i});
           }
         $$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i});          $$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i});
         $$subjects{$i}=~s/\n/\<br \/\>/g;          $$subjects{$i}=~s/\n/\<br \/\>/g;
         $$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i});          $$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i});
Line 1675  END Line 1677  END
                                       'bread_crumbs' => $brcrum,});                                        'bread_crumbs' => $brcrum,});
   
   if ($quote ne '') {    if ($quote ne '') {
       &newline_to_br(\$quote);        $quote = &HTML::Entities::decode($quote);
         unless (&contains_block_html($quote)) {
             &newline_to_br(\$quote);
         }
       $quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>';        $quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>';
   }    }
   
Line 2950  sub show_preview { Line 2955  sub show_preview {
 }  }
   
 sub contains_block_html {  sub contains_block_html {
  my ($message)=@_;      my ($message)=@_;
  return ($message =~ m/      return ($message =~ m{
  <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div)           <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) 
   [\s]*    \s*
  ([\w]+\=['"][\w]+['"])*   (\w+\=['"]\w+['"])*
   [\s]*    \s*
  (   (
   [\s]*[\/]>|    \s*/>|
   >.*<\/\1[\s]*>    >.*</\1\s*>
  )/xs );   )}xs 
       );
 }  }
   
 sub tidy_html {  sub tidy_html {

Removed from v.1.285  
changed lines
  Added in v.1.286


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