[prev in list] [next in list] [prev in thread] [next in thread]
List: rt-commit
Subject: [Rt-commit] [svn] r1933 - in rt/branches/3.3-TESTING: . lib/RT
From: jesse () pallas ! eruditorum ! org
Date: 2004-11-22 19:44:45
Message-ID: 20041122194445.C574D84C153 () pallas ! eruditorum ! org
[Download RAW message or body]
Author: jesse
Date: Mon Nov 22 14:44:43 2004
New Revision: 1933
Modified:
rt/branches/3.3-TESTING/ (props changed)
rt/branches/3.3-TESTING/lib/RT/Attachment_Overlay.pm
Log:
r9335@tinbook: jesse | 2004-11-22T19:44:48.685300Z
r9328@tinbook: jesse | 2004-11-22T19:23:06.663299Z
RT-Ticket: 6187
RT-Status: resolved
RT-Update: correspond
Refactored RT's core attachment processing logic to be a bit less baroque and to \
use new convenience methods. ths should prevent some mail header display strangeness \
folks were seeing.
Modified: rt/branches/3.3-TESTING/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/Attachment_Overlay.pm (original)
+++ rt/branches/3.3-TESTING/lib/RT/Attachment_Overlay.pm Mon Nov 22 14:44:43 2004
@@ -383,19 +383,16 @@
=head2 NiceHeaders
-Returns the To, From, Cc, Date and Subject headers.
-
-It is a known issue that this breaks if any of these headers are not
-properly unfolded.
+Returns a multi-line string of the To, From, Cc, Date and Subject headers.
=cut
sub NiceHeaders {
my $self = shift;
my $hdrs = "";
- my @hdrs = split(/\n/,$self->Headers);
+ my @hdrs = $self->_SplitHeaders;
while (my $str = shift @hdrs) {
- next unless $str =~ /^(To|From|RT-Send-Cc|Cc|Bcc:Date|Subject): /i;
+ next unless $str =~ /^(To|From|RT-Send-Cc|Cc|Bcc|Date|Subject):/i;
$hdrs .= $str . "\n";
$hdrs .= shift( @hdrs ) . "\n" while ($hdrs[0] =~ /^[ \t]+/);
}
@@ -418,10 +415,9 @@
sub Headers {
my $self = shift;
my $hdrs="";
- for ($self->_SplitHeaders) {
- $hdrs.="$_\n" unless /^(RT-Send-Bcc):/i
- }
- return $hdrs;
+ my @headers = grep { !/^RT-Send-Bcc/i } $self->_SplitHeaders;
+ return join("\n",@headers);
+
}
@@ -520,7 +516,7 @@
=head2 _SplitHeaders
Returns an array of this attachment object's headers, with one header
-per array entry. multiple lines are folded
+per array entry. multiple lines are folded.
=begin testing
_______________________________________________
Rt-commit mailing list
Rt-commit@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic