Bug 211128

Summary: plain text emails should not replace ampersand & with &
Product: [Applications] kdepimlibs Reporter: Brian DeRocher <brian>
Component: kpimutilsAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: arekm, psychonaut
Priority: NOR    
Version: 4.4   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Brian DeRocher 2009-10-19 21:49:42 UTC
Version:            (using KDE 4.3.2)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Looks like Kmail is changing & to &amp; in plain text emails.  The link is clickable and the correct URL is use (the one with &).  But i need to cut and paste this URL into Firefox.  The displayed version shows &amps;.  If you put &amp; in the location bar, the query string parameters are not separated correctly.

Content-Type: text/plain;
  charset=UTF-8

View source has:

https://green-site/?Ticket=85&Page=next

But the URL that is displays is:

https://green-site/?Ticket=85&amp;Page=next

Viewing the source code a little, it seems odd to me that a function called ObjectTreeParser::processTextPlainSubtype(...) is calling quoteHtmlChars() which does this:

case '&':
        result += "&amp;";
Comment 1 Tristan Miller 2009-10-28 15:49:10 UTC
This problem also occurs in KNode.  Is this some library bug then?
Comment 2 Arkadiusz Miskiewicz 2010-01-21 10:18:01 UTC
I can confirm that 4.4RC2 kmail is also affected. It changed URL:

https://sourceforge.net/tracker/?func=detail&atid=377408&aid=2936156&group_id=23067

to

https://sourceforge.net/tracker/?func=detail&amp;atid=377408&amp;aid=2936156&amp;group_id=23067

when displaying email content.
Comment 3 Arkadiusz Miskiewicz 2010-01-31 12:02:20 UTC
knode from 4.4rc2 is also affected
Comment 4 Thomas McGuire 2010-02-05 11:07:00 UTC
This sounds like a bug in KPIMUtils::LinkLocator to me.
Comment 5 Torgny Nyblom 2010-02-05 12:21:23 UTC
SVN commit 1085498 by tnyblom:

Don't double escape "&".

BUG: 211128


 M  +0 -1      linklocator.cpp  
 M  +4 -0      tests/testlinklocator.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1085498