Bug 8626 - Encoding problem with = in cart emails
Summary: Encoding problem with = in cart emails
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal
Assignee: Katrin Fischer
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 8621
  Show dependency treegraph
 
Reported: 2012-08-13 05:07 UTC by Katrin Fischer
Modified: 2013-12-05 19:59 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 8626: Fix encoding in cart emails for use of quoted-printable (1.55 KB, patch)
2012-08-14 06:39 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 8626: Fix encoding in cart emails for use of quoted-printable (1.51 KB, patch)
2012-08-14 14:32 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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