Bugzilla – Attachment 96383 Details for
Bug 22838
Warning from runreport.pl 'Explicitly setting a MIME header field (content-type) is dangerous'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22838: Remove MIME header warnings from runreports.pl
Bug-22838-Remove-MIME-header-warnings-from-runrepo.patch (text/plain), 1.79 KB, created by
Arthur Suzuki
on 2019-12-17 15:14:48 UTC
(
hide
)
Description:
Bug 22838: Remove MIME header warnings from runreports.pl
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2019-12-17 15:14:48 UTC
Size:
1.79 KB
patch
obsolete
>From 4a709648b360b9e45cccb9a66e323808d27d0443 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Tue, 17 Dec 2019 14:49:51 +0000 >Subject: [PATCH] Bug 22838: Remove MIME header warnings from runreports.pl > >Test plan: > - create a savedsql report > - run misc/cronjob/runreport.pl with options --format set to html and --to any email > - check plack errors log, you should get a warning > - apply patch > - repeat runreport.pl step > - check plack errors log, no additional warning there should be >--- > misc/cronjobs/runreport.pl | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 6732afae9c..fbea88944a 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -314,10 +314,7 @@ foreach my $report_id (@ARGV) { > } > if ($email) { > 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>"; >- $args->{contenttype} = 'text/html'; >- } >+ > my $email = Koha::Email->new(); > my %mail = $email->create_message_headers($args); > $mail{Data} = $message; >@@ -325,6 +322,12 @@ foreach my $report_id (@ARGV) { > > my $msg = MIME::Lite->new(%mail); > >+ if ( $format eq 'html' ) { >+ $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; >+ $args->{contenttype} = 'text/html'; >+ } >+ $msg-> attr("content-type" => $args->{contenttype}); >+ > $msg->attach( > Type => "text/$format", > Data => encode( 'utf8', $message ), >-- >2.20.1
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 22838
:
96383
|
96515
|
96641