Bugzilla – Attachment 22929 Details for
Bug 11248
Problems with translated list email sent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11248: Encoding issue on sending a list (OPAC)
Bug-11248-Encoding-issue-on-sending-a-list-OPAC.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2013-11-14 13:06:15 UTC
(
hide
)
Description:
Bug 11248: Encoding issue on sending a list (OPAC)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-14 13:06:15 UTC
Size:
2.10 KB
patch
obsolete
>From fd718313170b1153d125559c506b7eb6f3b7c813 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 14 Nov 2013 14:05:53 +0100 >Subject: [PATCH] Bug 11248: Encoding issue on sending a list (OPAC) > >See bug 10605 for more details. > >Test plan: >- send a list via email with the english version. >- translate templates and retry with another language. >--- > opac/opac-sendshelf.pl | 31 ++++++++++++++++++++++--------- > 1 file changed, 22 insertions(+), 9 deletions(-) > >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index 80b54e2..3f9b719 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -21,7 +21,7 @@ use strict; > use warnings; > > use CGI; >-use Encode; >+use Encode qw(decode encode); > use Carp; > > use Mail::Sendmail; >@@ -122,19 +122,32 @@ if ( $email ) { > > # Getting template result > my $template_res = $template2->output(); >+ my $body; > > # Analysing information and getting mail properties >- $mail{'subject'} = $template_res =~ /<SUBJECT>\n(.*)\n?<END_SUBJECT>/s >- ? $1 : "no subject"; >+ if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) { >+ $mail{subject} = $1; >+ $mail{subject} =~ s|\n?(.*)\n?|$1|; >+ } >+ else { $mail{'subject'} = "no subject"; } > >- my ($email_header) = $template_res =~ /<HEADER>\n(.*)\n?<END_HEADER>/s; >+ my $email_header = ""; >+ if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { >+ $email_header = $1; >+ $email_header =~ s|\n?(.*)\n?|$1|; >+ } > >- my $email_file = $template_res =~ /<FILENAME>\n(.*)\n?<END_FILENAME>/s >- ? $1 >- : "list.txt"; >+ my $email_file = "list.txt"; >+ if ( $template_res =~ /<FILENAME>(.*)<END_FILENAME>/s ) { >+ $email_file = $1; >+ $email_file =~ s|\n?(.*)\n?|$1|; >+ } > >- my ($body) = $template_res =~ /<MESSAGE>\n(.*)\n?<END_MESSAGE>/s; >- $body = encode_qp($body); >+ if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { >+ $body = $1; >+ $body =~ s|\n?(.*)\n?|$1|; >+ $body = encode("UTF-8", encode_qp($body)); >+ } > > my $boundary = "====" . time() . "===="; > >-- >1.7.10.4
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 11248
:
22927
|
22928
|
22929
|
22980
|
22981
|
22982
|
22983
|
22984
|
23360
|
23369
|
24140
|
24141
|
24142