After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 570898 - incomplete email address/mailto url matching
incomplete email address/mailto url matching
Status: RESOLVED OBSOLETE
Product: gnome-terminal
Classification: Core
Component: general
git master
Other All
: Normal minor
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on: 756038
Blocks:
 
 
Reported: 2009-02-07 21:08 UTC by Simon van der Linden
Modified: 2021-06-10 19:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
regexes reimplementation (9.75 KB, patch)
2009-02-08 17:07 UTC, Simon van der Linden
none Details | Review
regexes reimplementation (slightly improved) (9.92 KB, patch)
2009-02-09 00:16 UTC, Simon van der Linden
reviewed Details | Review

Description Simon van der Linden 2009-02-07 21:08:18 UTC
Please describe the problem:
None of the following addresses which are all valid and can be found in RFC 3696, section 4.3, are recognized properly (recognized part inside parenthesis).

user+mailbox@example.com (mailbox@example.com)
mailto:user%2Bmailbox@example.com (2Bmailbox@example.com)

customer/department=shipping@example.com (shipping@example.com)
mailto:customer%2Fdepartment=shipping@example.com (shipping@example.com)

$A12345@example.com (A12345@example.com)
mailto:$A12345@example.com (A12345@example.com)

!def!xyz%abc@example.com (abc@example.com)
mailto:!def!xyz%25abc@example.com (25abc@example.com)

_somename@example.com (somename@example.com)
mailto:_somename@example.com (somename@example.com)

Moreover, even if the addresses would be recognized, opening one of them would cause g-t to prefix it with "mailto:" instead of prefixing it AND encoding it.

Steps to reproduce:



Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Simon van der Linden 2009-02-07 21:09:47 UTC
And we see that Bugzilla is not perfect either, but does a slightly better job.
Comment 2 Mariano Suárez-Alvarez 2009-02-07 21:44:48 UTC
One if these days, the URL matcher in gnome-terminal is going to be come self-aware and we'll all be done for :/
Comment 3 Simon van der Linden 2009-02-08 17:07:14 UTC
Created attachment 128236 [details] [review]
regexes reimplementation

I took the RFC3986 which contains the generic URI grammar and implemented it (I didn't find such a regex in GNOME libraries). It is a bit larger than it was before, but no one will complain about an URL not being recognized. I think g-t shouldn't care about the kind of URL (http, h323, mailto, or whatever), it should just propose to open/copy them with GNOME which will handle it the way it is configured for.

Beside this, I took the RFC3696 and implemented something for email addresses.

For now, all of the above mailto URL's and addresses are properly recognized.

And BTW, it fixes #448044 and #546628.
Comment 4 Simon van der Linden 2009-02-09 00:16:55 UTC
Created attachment 128258 [details] [review]
regexes reimplementation (slightly improved)

* slightly improved performance regarding last version
* useless rules commented
* regressions fixed regarding www addresses
Comment 5 Simon van der Linden 2009-02-09 00:19:11 UTC
Comment on attachment 128236 [details] [review]
regexes reimplementation

obsolete
Comment 6 Christian Persch 2009-06-01 19:34:39 UTC
src/terminal-util.c

What was the point of switching from g_strdup_printf() to g_string_new + g_string_append ?

Apart from that, looks good.
Comment 7 Christian Persch 2016-02-21 15:17:58 UTC
All fixed by the regex rewrite from bug 756038.
Comment 8 Egmont Koblinger 2017-12-17 22:28:26 UTC
Reopening, the big regex rewrite did _not_ fix these special cases mentioned in comment 0.
Comment 9 GNOME Infrastructure Team 2021-06-10 19:53:38 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/6784.