[Rt-commit] rt branch, 4.2/attach-from-transactions, updated. rt-4.0.1-404-gd164d13
Thomas Sibley
trs at bestpractical.com
Mon Sep 19 13:57:45 EDT 2011
The branch, 4.2/attach-from-transactions has been updated
via d164d13c060afa8a392e14dbd3c2e93e7067657e (commit)
from 2844b2af88e8739fdb642ebb082e15d3bd87f4fb (commit)
Summary of changes:
lib/RT/Action/SendEmail.pm | 2 ++
share/html/Ticket/Elements/ShowMessageHeaders | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit d164d13c060afa8a392e14dbd3c2e93e7067657e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Mon Sep 19 13:43:41 2011 -0400
Headers often come with leading spaces, which make SQLite choke on comparisons
This was noticed because of test failures, but does affect functionality
on SQLite. Pg and MySQL can Do The Right Thing since they know they're
dealing with numeric types.
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index f162fab..3c32419 100644
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -428,6 +428,8 @@ sub AddAttachmentsFromHeaders {
# Take all RT-Attach headers and add the attachments to the outgoing mail
my $seen_attachment = 0;
for my $id (uniq $email->head->get_all('RT-Attach')) {
+ $id =~ s/(?:^\s*|\s*$)//g;
+
my $attach = RT::Attachment->new( $self->TransactionObj->CreatorObj );
$attach->Load($id);
next unless $attach->Id
diff --git a/share/html/Ticket/Elements/ShowMessageHeaders b/share/html/Ticket/Elements/ShowMessageHeaders
index 5220f9a..4d3baa5 100755
--- a/share/html/Ticket/Elements/ShowMessageHeaders
+++ b/share/html/Ticket/Elements/ShowMessageHeaders
@@ -79,6 +79,8 @@ my $ticket = $Message->TransactionObj->TicketObj;
foreach my $f (@headers) {
$m->comp('/Elements/MakeClicky', content => \$f->{'Value'}, ticket => $ticket, %ARGS);
if ($f->{'Tag'} eq 'RT-Attach') {
+ $f->{'Value'} =~ s/(?:^\s*|\s*$)//g;
+
# Blat in the filename and linkify
my $att = RT::Attachment->new( $session{'CurrentUser'} );
$att->Load($f->{'Value'});
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list