Bugzilla – Attachment 82840 Details for
Bug 21875
Handling subject line in Letters.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21875: Handling subject line in Letters.pm
0001-Bug-21875-Handling-subject-line-in-Letters.pm.patch.txt (text/plain), 2.54 KB, created by
Marcel de Rooy
on 2018-12-04 14:56:22 UTC
(
hide
)
Description:
Bug 21875: Handling subject line in Letters.pm
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-12-04 14:56:22 UTC
Size:
2.54 KB
patch
obsolete
>From cd27ea98d844502be1d206cedb3df694626684f3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 23 Nov 2018 11:36:49 +0100 >Subject: [PATCH] Bug 21875: Handling subject line in Letters.pm >MIME-Version: 1.0 >Content-Type: text/plain; charset=utf-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset=utf-8 > >The variable name $utf8 is very misleading: it contains MIME-Header encoding. >$message->{subject} comes from the database and is in perl internal format; >it should NOT be decoded as a MIME-Header. >After encoding to MIME-Header, previously another (useless) encoding to >UTF-8 was done. Since the string is plain ASCII, this is useless and >theoretically wrong. We should stay in MIME-Header. > >Test plan: >[1] Make Koha send a queue message with a plain ASCII subject line. Verify the subject line at the receiving side. >Possible in many ways. Here is one: Enable list sharing and send a share invitation on a list with a plain ASCII text name like "L2". >[2] Now send a subject line with some Latin chars. Verify. >Rename your list L2 from step 1 to L2áéò. Send another share invitation. >[3] Now send a subject line with some 'real' Unicode chars. Verify. >Rename L2áéò to L2áéòç±è¦. Repeat the invite. >[4] Now include MIME encoding in the list name. (To make Martin happy ;) Verify. >Rename L2áéòç±è¦ to =?UTF-8?B?IHBlcmwgSsO8?= (include the equal signs) >Since I gave the list a strange and ugly name, I would like to see that name in the subject line. (You will also see it in the message body.) >Note: Without this patch the subject line is decoded to "Share list perl Jü". This is wrong, because it is not my list name! >Bonus: Try some other email address/mail program too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Letters.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 5382819..c1a678b 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1283,9 +1283,10 @@ sub _send_message_by_email { > } > } > >- my $utf8 = decode('MIME-Header', $message->{'subject'} ); >- $message->{subject}= encode('MIME-Header', $utf8); >- my $subject = encode('UTF-8', $message->{'subject'}); >+ # Encode subject line separately >+ $message->{subject} = encode('MIME-Header', $message->{'subject'} ); >+ my $subject = $message->{'subject'}; >+ > my $content = encode('UTF-8', $message->{'content'}); > my $content_type = $message->{'content_type'} || 'text/plain; charset="UTF-8"'; > my $is_html = $content_type =~ m/html/io; >-- >2.1.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 21875
:
82601
|
82611
|
82840
|
82841
|
85139
|
85317