DevHeads.net

Review Request 119221: Don't rewrite mailto: URLs als mailto://

Review request for kdelibs.

Repository: kdelibs

Description
KUrl::prettyUrl() rewrites mailto: URLs als <a href="mailto://" title="mailto://">mailto://</a> if the "path" is empty.
MUAs don't handle <a href="mailto://" title="mailto://">mailto://</a> URLs correctly.

<a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>
and
<a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>
are both valid and semantically equivalent.

KUrl::prettyUrl() converts the latter one to <a href="mailto://?to= ... at example dot com" title="mailto://?to= ... at example dot com">mailto://?to= ... at example dot com</a>

This works fine:
kde-open <a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>

but this fails:
kde-open <a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>

For example with Thunderbird it creates a mail with:

The proposed change special cases mailto so it always uses mailto: instead of <a href="mailto://" title="mailto://">mailto://</a>.

Diffs
kdecore/io/kurl.cpp 8c491f7
kdecore/tests/kurltest.cpp 1fd204f

Diff: <a href="https://git.reviewboard.kde.org/r/119221/diff/" title="https://git.reviewboard.kde.org/r/119221/diff/">https://git.reviewboard.kde.org/r/119221/diff/</a>

Testing
Tested with kdelibs 4.13.2 and Thunderbird, Evolution and KMail.

Thanks,

Felix Geyer

Comments

Re: Review Request 119221: Don't rewrite mailto: URLs als mailto

By Felix Geyer at 07/14/2014 - 11:47

(Updated July 14, 2014, 4:47 p.m.)

Review request for kdelibs and David Faure.

Repository: kdelibs

Description (updated)
KUrl::prettyUrl() rewrites mailto: URLs als <a href="mailto://" title="mailto://">mailto://</a> if the "path" is empty.
MUAs don't handle <a href="mailto://" title="mailto://">mailto://</a> URLs correctly.

<a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>
and
<a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>
are both valid and semantically equivalent.

KUrl::prettyUrl() converts the latter one to <a href="mailto://?to= ... at example dot com" title="mailto://?to= ... at example dot com">mailto://?to= ... at example dot com</a>

This works fine:
kde-open <a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>

but this fails:
kde-open <a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>

For example with Thunderbird it creates a mail with:

The <a href="mailto://" title="mailto://">mailto://</a> behavior was introduced with <a href="http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951172e5fb32b38804fa5" title="http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951172e5fb32b38804fa5">http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951...</a>

The proposed change special cases mailto so it always uses mailto: instead of <a href="mailto://" title="mailto://">mailto://</a>.

Diffs
kdecore/io/kurl.cpp 8c491f7
kdecore/tests/kurltest.cpp 1fd204f

Diff: <a href="https://git.reviewboard.kde.org/r/119221/diff/" title="https://git.reviewboard.kde.org/r/119221/diff/">https://git.reviewboard.kde.org/r/119221/diff/</a>

Testing
Tested with kdelibs 4.13.2 and Thunderbird, Evolution and KMail.

Thanks,

Felix Geyer

Re: Review Request 119221: Don't rewrite mailto: URLs als mailto

By Felix Geyer at 07/16/2014 - 16:40

(Updated July 16, 2014, 9:40 p.m.)

Status
This change has been marked as submitted.

Review request for kdelibs and David Faure.

Repository: kdelibs

Description
KUrl::prettyUrl() rewrites mailto: URLs als <a href="mailto://" title="mailto://">mailto://</a> if the "path" is empty.
MUAs don't handle <a href="mailto://" title="mailto://">mailto://</a> URLs correctly.

<a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>
and
<a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>
are both valid and semantically equivalent.

KUrl::prettyUrl() converts the latter one to <a href="mailto://?to= ... at example dot com" title="mailto://?to= ... at example dot com">mailto://?to= ... at example dot com</a>

This works fine:
kde-open <a href="mailto: ... at example dot com" title="mailto: ... at example dot com">mailto: ... at example dot com</a>

but this fails:
kde-open <a href="mailto:?to= ... at example dot com" title="mailto:?to= ... at example dot com">mailto:?to= ... at example dot com</a>

For example with Thunderbird it creates a mail with:

The <a href="mailto://" title="mailto://">mailto://</a> behavior was introduced with <a href="http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951172e5fb32b38804fa5" title="http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951172e5fb32b38804fa5">http://quickgit.kde.org/?p=kdelibs.git&amp;a=commit&amp;h=c67bfaf855e2345fd08951...</a>

The proposed change special cases mailto so it always uses mailto: instead of <a href="mailto://" title="mailto://">mailto://</a>.

Diffs
kdecore/io/kurl.cpp 8c491f7
kdecore/tests/kurltest.cpp 1fd204f

Diff: <a href="https://git.reviewboard.kde.org/r/119221/diff/" title="https://git.reviewboard.kde.org/r/119221/diff/">https://git.reviewboard.kde.org/r/119221/diff/</a>

Testing
Tested with kdelibs 4.13.2 and Thunderbird, Evolution and KMail.

Thanks,

Felix Geyer

Re: Review Request 119221: Don't rewrite mailto: URLs als mailto

By David Faure at 07/15/2014 - 08:31

Looks good, apart from the issue below.

<a href="https://codereview.qt-project.org/89860" title="https://codereview.qt-project.org/89860">https://codereview.qt-project.org/89860</a> shows that this should be fine in Qt5/KF5.

kdecore/io/kurl.cpp
<https://git.reviewboard.kde.org/r/119221/#comment43337>

This comparison should be case insensitive, see (QString::compare(scheme(), QLatin1String("mailto"), Qt::CaseInsensitive) == 0 in KUrl::url().

- David Faure

On July 14, 2014, 4:47 p.m., Felix Geyer wrote:

Re: Review Request 119221: Don't rewrite mailto: URLs als mailto

By Felix Geyer at 07/16/2014 - 16:40

Ack.
There seem to be a bunch of other case-sensitive comparison with the scheme in kurl.

- Felix

On July 16, 2014, 9:40 p.m., Felix Geyer wrote:

Re: Review Request 119221: Don't rewrite mailto: URLs als mailto

By Scott Kitterman at 07/10/2014 - 20:32

This change makes kdelibs consistent with RFC 2368 (which defined the mailto URL scheme).

- Scott Kitterman

On July 10, 2014, 8:40 p.m., Felix Geyer wrote: