Bug 313719 - A URL followed by a ) is parsed incorrectly in message viewer
Summary: A URL followed by a ) is parsed incorrectly in message viewer
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.9.98 RC3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-23 00:03 UTC by Elias Probst
Modified: 2013-02-16 07:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.1


Attachments
mbox file to reproduce the URL parsing issue in message viewer. (801 bytes, application/mbox)
2013-01-23 00:03 UTC, Elias Probst
Details
Attachment to describe the 2nd related issue from comment#1 (913 bytes, application/mbox)
2013-02-15 17:00 UTC, Elias Probst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2013-01-23 00:03:22 UTC
Created attachment 76651 [details]
mbox file to reproduce the URL parsing issue in message viewer.

If a  maill contains an URL which is directly followed by a ) the URL parser of the messageviewer causes several troubles:

- The trailing ) is included in the text-higlighting to make the URL clickable
- The trailing ) is shown as part of the URL in the status bar when hovering the URL
- Clicking on the URL just shows the error message: "Malformed URL http:"
- Right click → Copy → Paste somewhere else just pastes "http:", nothing else

So far I could reproduce this issue only when having the URL followed by )  but not when using other characters like !#?

Attached is a mbox file which can be used to reproduce this issue.
Comment 1 Elias Probst 2013-02-15 16:59:22 UTC
I just discovered a related issue.

If the mail contains text like this:
See the homepage (http://www.kde.org - section 5.2) for more details

The result rendered by message viewer is:
See the homepage (http://www.kde.org-section5.2) for more details

In contrast to the initial report, the URL when clicking on it is not only http://, but the full wrongly parsed URL:
http://www.kde.org-section5.2
Comment 2 Elias Probst 2013-02-15 17:00:51 UTC
Created attachment 77337 [details]
Attachment to describe the 2nd related issue from comment#1

The attachment contains an mbox which can be used to reproduce the 2nd issue described in comment#1
Comment 3 Laurent Montel 2013-02-15 17:41:51 UTC
Which apps create this email ? KMail ?
Comment 4 Elias Probst 2013-02-15 17:52:17 UTC
(In reply to comment #3)
> Which apps create this email ? KMail ?
Yes, KMail2 (4.10) is used, but I think that's not relevant at all, as the issue happens when parsing the mail in message viewer.
If you have a look at the attached mbox files, you'll see that the plain text of the mail looks correctly.
Comment 5 Laurent Montel 2013-02-15 18:36:20 UTC
Git commit 0434b8cff1826c4a46d16eab88c6ab2ad3d657c2 by Montel Laurent.
Committed on 15/02/2013 at 19:34.
Pushed by mlaurent into branch 'KDE/4.10'.

Start to fix Bug 313719 - A URL followed by a ) is parsed incorrectly in message viewer

now when we have just (http://www.kde.org) it's parsed correctly

will continue to look at specific bug when detect url

M  +2    -2    kpimutils/linklocator.cpp

http://commits.kde.org/kdepimlibs/0434b8cff1826c4a46d16eab88c6ab2ad3d657c2
Comment 6 Laurent Montel 2013-02-15 18:44:41 UTC
Git commit b0cdec92702704f4660809e2ec696a0ee32f2b16 by Montel Laurent.
Committed on 15/02/2013 at 19:43.
Pushed by mlaurent into branch 'KDE/4.10'.

Don't look at (...) for url. Otherwise it will remove space in url

when we want to show (http://www.kde.org - section 5.2) and we don't want it.

M  +2    -2    kpimutils/linklocator.cpp

http://commits.kde.org/kdepimlibs/b0cdec92702704f4660809e2ec696a0ee32f2b16
Comment 7 Laurent Montel 2013-02-15 18:45:08 UTC
last commit fix commit 1
Comment 8 Laurent Montel 2013-02-15 18:53:21 UTC
Git commit 3df67f6979d3a726d4c74c78feab9b4f854680cb by Montel Laurent.
Committed on 15/02/2013 at 19:52.
Pushed by mlaurent into branch 'KDE/4.10'.

Fix Bug 313719 - A URL followed by a ) is parsed incorrectly in message viewer

now we can set correct url when we finish url by ). or other special exclude characters

FIXED-IN: 4.10.1

M  +10   -6    kpimutils/linklocator.cpp

http://commits.kde.org/kdepimlibs/3df67f6979d3a726d4c74c78feab9b4f854680cb
Comment 9 Elias Probst 2013-02-15 23:49:22 UTC
Thanks for the fixes, all of them work here applied against kdepimlibs-4.10.0.

I wanted to re-assing the bug to the correct product/component, but I'm not sure which kdepimlibs component is appropriate.

Could you please do it, so this bug shows up correctly in auto-generated changelogs for 4.10.1?
Comment 10 Laurent Montel 2013-02-16 07:51:49 UTC
better to keep on kmail2 I think.