[Rt-commit] rt branch, 4.4/insert-raw-html-articles, repushed

Maureen Mirville maureen at bestpractical.com
Fri May 4 16:04:08 EDT 2018


The branch 4.4/insert-raw-html-articles was deleted and repushed:
       was 20a561b0cc9b647d28d89e9c9369660e36e02dd2
       now 901ba7003490bee0b902bd75ab40d4bbeb86db4d

1: 20a561b0c ! 1: 4c4a75522 Add option to disable escaping HTML in articles
    @@ -1,6 +1,6 @@
     Author: Maureen E. Mirville <maureen at bestpractical.com>
     
    -    Add option to allow raw HTML to display in articles
    +    Add option to disable escaping HTML in articles
     
     diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
     --- a/share/html/Admin/Articles/Classes/Modify.html
    @@ -10,8 +10,8 @@
          <label for="Include-Summary"><&|/l&>Include article summary</&></label>
      </li>
     +<li>
    -+     <input type="checkbox" id="Include-RawHTML" name="Include-RawHTML" value="1" <% $include{RawHTML} %>>
    -+     <label for="Include-RawHTML"><&|/l&>Allow raw HTML (potentially unsafe)</&></label>
    ++     <input type="checkbox" id="Include-EscapeHTML" name="Include-EscapeHTML" value="1" <% $include{EscapeHTML} %>>
    ++     <label for="Include-EscapeHTML"><&|/l&>Escape HTML (Unchecking this box is potentially unsafe)</&></label>
     +</li>
      % if ( $cfs ) {
      % while (my $cf = $cfs->Next) {
    @@ -21,7 +21,7 @@
      }
      
     -my %include = (Name => 1, Summary => 1);
    -+my %include = (Name => 1, Summary => 1, RawHTML => 1);
    ++my %include = (Name => 1, Summary => 1, EscapeHTML => 1);
      my $subject_cfs = [];
      my $subject_cf_labels = {};
      
    @@ -30,13 +30,11 @@
     --- a/share/html/Articles/Article/Elements/Preformatted
     +++ b/share/html/Articles/Article/Elements/Preformatted
     @@
    - %   }
      % }
      <%init>
    -+
      my $class = $Article->ClassObj;
     -my %include = (Name => 1, Summary => 1);
    -+my %include = (Name => 1, Summary => 1, RawHTML => 1);
    ++my %include = (Name => 1, Summary => 1, EscapeHTML => 1);
      my $cfs = $class->ArticleCustomFields;
      $include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next;
      $include{$_} = not $class->FirstAttribute("Skip-$_") for keys %include;
    @@ -44,7 +42,8 @@
              content => \$content,
          );
      
    -+return $content unless !$include{'RawHTML'};
    ++    return $content unless $include{'EscapeHTML'};
          if ( $content =~ /<.{1,5}>/ ) {
              $content = RT::Interface::Email::ConvertHTMLToText( $content );
          }
    +
-:  ------- > 2: 901ba7003 Updated Articles docs to include disabled escaped HTML



More information about the rt-commit mailing list