[Rt-commit] rt branch, 5.0/additional-munge-attachments-features, repushed

Craig Kaiser craig at bestpractical.com
Tue Nov 10 11:56:00 EST 2020


The branch 5.0/additional-munge-attachments-features was deleted and repushed:
       was f8b3210e4509289fec55cf5755299e5e0ee2fa7c
       now bdbfb7fcb00aaf83f0eb5309f84857cdac179099

1: b33f90ae96 ! 1: a377355472 Allow header and content munging to be disabled by flags
    @@ -10,7 +10,7 @@
      my %opts;
      use Getopt::Long;
     -GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s' );
    -+GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'no-headers', 'no-content' );
    ++GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'skip-headers', 'skip-content' );
      
      if ( $opts{'help'} || !$opts{'search'} ) {
          require Pod::Usage;
    @@ -18,8 +18,8 @@
      use RT -init;
      
      my $replacement = $opts{'replacement'} || '';
    -+my $headers     = $opts{'no-headers'} ? 0 : 1;
    -+my $content     = $opts{'no-content'} ? 0 : 1;
    ++my $headers     = $opts{'skip-headers'} ? 0 : 1;
    ++my $content     = $opts{'skip-content'} ? 0 : 1;
      
      my $search = $opts{'search'};
      
    @@ -36,15 +36,15 @@
      which might bypass attachments of which contents are encoded(like
      base64). Use this option to prevent the pre-filter behavior.
      
    -+=item --no-headers
    ++=item --skip-headers
     +
     +BY default headers are also munged, to disable munging of headers set the
    -+--no-headers flag.
    ++--skip-headers flag.
     +
    -+=item --no-content
    ++=item --skip-content
     +
     +BY default transaction content is munged, to disable munging of content set the
    -+--no-content flag.
    ++--skip-content flag.
     +
      =back
     
2: f8b3210e45 ! 2: bdbfb7fcb0 Allow specifying of transactions for rt-munge-attachments to munge
    @@ -9,8 +9,8 @@
      # Read in the options
      my %opts;
      use Getopt::Long;
    --GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'no-headers', 'no-content' );
    -+GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'transactions=s', 'no-headers', 'no-content' );
    +-GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'skip-headers', 'skip-content' );
    ++GetOptions( \%opts, "help|h", "search=s", "replacement=s", 'tickets=s', 'transactions=s', 'skip-headers', 'skip-content' );
      
      if ( $opts{'help'} || !$opts{'search'} ) {
          require Pod::Usage;
    @@ -46,6 +46,15 @@
      
      my ( $ret, $msg ) = $attachments->ReplaceAttachments(
     @@
    +     Content     => $content,
    +     Search      => Encode::decode( 'UTF-8', $search ),
    +     Replacement => Encode::decode( 'UTF-8', $replacement ),
    +-    $opts{tickets} ? ( FilterBySearchString => 0 ) : (),
    ++    $opts{tickets} || $opts{transactions} ? ( FilterBySearchString => 0 ) : (),
    + );
    + print STDERR $msg . "\n";
    + 
    +@@
      
      =item --tickets=1,2,3
      
    @@ -59,8 +68,8 @@
     +=item --transactions=123,456,7
     +
     +Limit attachments to the specified transactions. If specified the default pre-filtering
    -+will be prevented. This option takes precedence over the --tickets flag.
    ++will be prevented. This option can work alongside the --tickets flag.
     +
    - =item --no-headers
    + =item --skip-headers
      
      BY default headers are also munged, to disable munging of headers set the



More information about the rt-commit mailing list