Bugzilla – Attachment 44561 Details for
Bug 15133
runreport.pl badly encode accented characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15133: encode correctly email generated by runreport.pl
PASSED-QA-Bug-15133-encode-correctly-email-generat.patch (text/plain), 2.78 KB, created by
Kyle M Hall (khall)
on 2015-11-06 13:41:56 UTC
(
hide
)
Description:
[PASSED QA] Bug 15133: encode correctly email generated by runreport.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-11-06 13:41:56 UTC
Size:
2.78 KB
patch
obsolete
>From bbaf242b4e7c5634a64f778bdfbb91da0065a5cb Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Thu, 5 Nov 2015 08:45:25 +0100 >Subject: [PATCH] [PASSED QA] Bug 15133: encode correctly email generated by runreport.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >/misc/cronjobs/runreport.pl send badly encoded email in text/csv >(partially ok in HTML). > >TEST: > >1. Send by email a report containing a subject with accented characters > and resultset with accented characters. For example: > > ./runreport.pl --subject="éèà " --to=me@home.org 1 > ./runreport.pl --format=html --subject="éèà " --to=me@home.org 1 > > The first email contains badly encoded subject & message. The second email > contains badly encoded subject, but correct message. > >2. Apply the patch > >3. Repeat 1 => No more strange characters. > >Signed-off-by: Liz Rea <liz@catalyst.net.nz> >Characters are correctly encoded now, thanks for that good spot. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/runreport.pl | 25 ++++++------------------- > 1 files changed, 6 insertions(+), 19 deletions(-) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 6b25908..9afec7e 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -273,27 +273,14 @@ foreach my $report_id (@ARGV) { > } > } > if ($email){ >- my $email = Koha::Email->new(); >- my %mail; >+ my $args = { to => $to, from => $from, subject => $subject }; > if ($format eq 'html') { >- $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; >- %mail = $email->create_message_headers({ >- to => $to, >- from => $from, >- contenttype => 'text/html', >- subject => encode('utf8', $subject ), >- message => encode('utf8', $message ) >- } >- ); >- } else { >- %mail = $email->create_message_headers ({ >- to => $to, >- from => $from, >- subject => encode('utf8', $subject ), >- message => encode('utf8', $message ) >- } >- ); >+ $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; >+ $args->{contenttype} = 'text/html'; > } >+ $args->{message} = $message; >+ my $email = Koha::Email->new(); >+ my %mail = $email->create_message_headers($args); > $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username; > sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; > } else { >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15133
:
44462
|
44525
| 44561