Bug 8626

Summary: Encoding problem with = in cart emails
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, mtj, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 8621    
Attachments: Bug 8626: Fix encoding in cart emails for use of quoted-printable
Bug 8626: Fix encoding in cart emails for use of quoted-printable

Description Katrin Fischer 2012-08-13 05:07:57 UTC
I have testes this with Outlook Web Access and Thunderbird so far and both mail clients show the problem:

Original URL:
http://localhost/cgi-bin/koha/opac-detail.pl?biblionumber=5100

Thunderbird/OWA:
http://localhost/cgi-bin/koha/opac-detail.pl?biblionumberQ00

I have tracked down the problem with the URLs to it being a problem with encoding and the = character. 

Currently we have following line sin opac-sendbasket.pl:

MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

It seems that with this setting the = is interpreted as the beginning of a special character. So if you have a URL or Title containing = it will not be displayed correctly.
Comment 1 Mason James 2012-08-13 05:26:05 UTC
(In reply to comment #0)
> I have testes this with Outlook Web Access and Thunderbird so far and both
> mail clients show the problem:
> 
> Original URL:
> http://localhost/cgi-bin/koha/opac-detail.pl?biblionumber=5100
> 
> Thunderbird/OWA:
> http://localhost/cgi-bin/koha/opac-detail.pl?biblionumberQ00
> 
> I have tracked down the problem with the URLs to it being a problem with
> encoding and the = character. 
> 
> Currently we have following line sin opac-sendbasket.pl:
> 
> MIME-Version: 1.0
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
> 
> It seems that with this setting the = is interpreted as the beginning of a
> special character. So if you have a URL or Title containing = it will not be
> displayed correctly.


hi Cait

i think we could fix this bug using Email::Simple
 http://search.cpan.org/~rjbs/Email-Simple-2.102/lib/Email/Simple.pm
Comment 2 Katrin Fischer 2012-08-13 06:19:51 UTC
147 $body = encode_qp($1); 

Seems to work right, but needs more testing.
Comment 3 Chris Cormack 2012-08-13 07:59:53 UTC
2 options

Either we don't set it to quoted-printable in the mail headers.
Or we set that, and encode.
Comment 4 Katrin Fischer 2012-08-13 08:15:53 UTC
After deleting the line "Content-Transfer-Encoding: quoted-printable" it also worked nicely in my tests. Can we do that or what is the right value to be used with utf-8 data?
Comment 5 Katrin Fischer 2012-08-14 06:39:31 UTC Comment hidden (obsolete)
Comment 6 Jared Camins-Esakov 2012-08-14 14:32:59 UTC
Created attachment 11610 [details] [review]
Bug 8626: Fix encoding in cart emails for use of quoted-printable

When using quoted-printable data needs to be encoded accordingly.

Content-Transfer-Encoding: quoted-printable

Without the patch = in URLs or data will be interpreted as the beginning
of a special character resulting in broken URLs.

To test:
- Check diacritics in records display correctly
- Check various URLs with = to make sure they all work correctly

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This is only a partial fix, as the subject line is not encoded,
but it is a huge improvement over what it was before.
Comment 7 Jonathan Druart 2012-08-17 12:03:50 UTC
QA comments:
It seems the good way to do that (already used in basket/sendbasket.pl, opac/opac-sendshelf.pl and virtualshelves/sendshelf.pl).
Marked as Passed QA
Comment 8 Paul Poulain 2012-08-29 16:16:02 UTC
Patch pushed to master
Comment 9 Chris Cormack 2012-08-29 22:09:54 UTC
Pushed to 3.8.x will be in 3.8.5