Trailing closing bracket in URL not considered part of the URL

Bug #408315 reported by Brian Brazil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xfce4-terminal
Fix Released
Medium
xfce4-terminal (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: xfce4-terminal

When I'm on IRC, it's fairly common for someone to link to Wikipedia with a URL such as "http://en.wikipedia.org/wiki/Disambiguation_(audio)".

The problem is that the link when you hover or right click doesn't recognise the closing bracket as being part of the URL, instead going to "http://en.wikipedia.org/wiki/Disambiguation_(audio", which obviously doesn't work.

The terminal should recognise the closing bracket as being part of the URL.

I'm on Hardy.

Revision history for this message
Brian Brazil (bbrazil) wrote :

Aside: the equivalent bug in Launchpad itself is https://bugs.launchpad.net/ubuntu/+bug/118284

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Are there any applications that parse the final ")" ? I am not sure this is even possible to be to distinguish the closing brackets for the very reasons given in the launchpad bug referenced. The ones I tried do not.

Changed in xfce4-terminal (Ubuntu):
status: New → Invalid
Revision history for this message
Brian Brazil (bbrazil) wrote :

The launchpad bug gives no technical reason why this isn't possible, merely an assertion that this bug arises from the desire to handle a URL inside braces, and that this bug should be fixed in launchpad. Accordingly, I see no reason to mark this bug "Invalid".

Changed in xfce4-terminal (Ubuntu):
status: Invalid → New
Changed in xfce4-terminal (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
In , Ikonta (ikonta) wrote :

XFce Terminal suggests to copy url into memory buffer.

If source string looks like:
<a>http://ya.ru/</a>
operation is correct.

But if url doesn't contain tailing '/', terminal copies +1 symbol (doesn't check close tag?).
I.e. if the source string is:
<a>http://ya.ru</a>
In the memory buffer is copied (and pasted) incorrect url string:
'http://ya.ru<'

P.S. If trying to copy url from href argument of 'a' tag both cases (i.e. present and missed tailing '/') works correctly.

Revision history for this message
In , Jshipley-2 (jshipley-2) wrote :

URL recognition seems to have a few problems (and seems to work mostly the same as gnome-terminal which isn't surprising since it looks like both applications use nearly identical regexes to match).

The opening character of a pair ('(', '<', '{', and '[') get added to the URL but terminate the URL. The exception to this is when they directly follow a '/' (not necessarily tailing, "http://www.foo.com/(whatisthis/more" would be recognized as "http://www.foo.com/"). This causes problems for wikipedia style links with '(' and ')' in them (https://bugzilla.xfce.org/show_bug.cgi?id=9800). The closing character of the pair does not get recognized as part of the URL.

Actually, it looks like any single character following a slash will be ignored.

http://www.foo.com/a matches http://www.foo.com/
http://www.foo.com/ab matches http://www.foo.com/ab

If the current regex can't be easily fixed, it may be worth looking into http://daringfireball.net/2010/07/improved_regex_for_matching_urls as a replacement.

I'm going to spend some time with this, and see if I can come up with a good patch.

Revision history for this message
In , Ncopa (ncopa) wrote :

Created attachment 5099
Patch from dev mailing list

this is the patch Jeff sent to mailing list.

It also fixes bug #9800 but I post it only here.

Revision history for this message
In , Jshipley-2 (jshipley-2) wrote :

Created attachment 5100
patch without duplicate USERS define

I recreated the above patch as it duplicated the "#define USERS" line instead of just changing it.

Revision history for this message
In , 8-nick (8-nick) wrote :

*** Bug 9800 has been marked as a duplicate of this bug. ***

Revision history for this message
In , 8-nick (8-nick) wrote :

Pushed in 2e1c325. Thanks.

Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

The xfce4-terminal version provided by Ubuntu 14.04 already includes the patch for this bug.

http://git.xfce.org/apps/xfce4-terminal/commit/?id=2e1c32557bcb053c30e5c65eb6fe10929c5683d7

Changed in xfce4-terminal (Ubuntu):
status: New → Fix Released
Changed in xfce4-terminal:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.