Closed Bug 301363 Opened 19 years ago Closed 19 years ago

Auto-highlight of URLs with parentheses produces wrong link

Categories

(Thunderbird :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mozillabugs, Assigned: mscott)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050719 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050719 Firefox/1.0+

If you receive an email containing a URL in the body which contains parentheses,
such as http://www.discogs.com/artist/Ilya+(2) , the auto-linkifying of the URL
fails by forgetting to include the closing ')' in the link.  If you click on the
example link from within an email, it will take you to
http://www.discogs.com/artist/Ilya+(2

Another example: http://wikisource.org/wiki/Middle_East_Policy_(Chomsky)

RFC 2396 (http://www.ietf.org/rfc/rfc2396.txt) states that parentheses are valid
characters within a URL, so these should be handled correctly and linkified as
expected.

Reproducible: Always

Steps to Reproduce:
1. Send yourself an email containing the following URL:
http://www.discogs.com/artist/Ilya+(2)
2. Open the email, notice the closing ')' is not linkified
3. Click the link

Actual Results:  
Browser launches and takes you to http://www.discogs.com/artist/Ilya+(2

Expected Results:  
Browser should launch and take you to http://www.discogs.com/artist/Ilya+(2)
Hmm.. looks like bugzilla suffers from the same bug.  :)
Duplicate of/related to Core bug 133016?

*** This bug has been marked as a duplicate of 133016 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You just gave a reason why this is WONTFIX:
> RFC 2396 (http://www.ietf.org/rfc/rfc2396.txt) sta...
> such as http://www.discogs.com/artist/Ilya+(2) , the au

How is the code supposed to know to not include the ")" in the first line, while
including it in the second line?

That's why the URLs you gave won't be fixed in bug 133016, at most URLs having
")" in the middle (not at the end).
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
WONTIFX
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → WONTFIX
(http://www.ietf.org/rfc/rfc2396.txt)
vs.
http://www.discogs.com/artist/Ilya+(2)

Because in the first link, the opening '(' occurs before the 'http://' begins. 
That can be used as a testcase to see whether or not to linkify the closing ')'.

If it finds a closing ')' it should check if there is a matching '(' before or
after http://.  If one occurs AFTER the 'http://', the second ')' should be
linkified, if there is not, it shouldn't.

> Because in the first link, the opening '(' occurs before the 'http://' begins.

That's not always the case (like here https://bugzi...). How far do we search
back? It might cross linebreaks, in which case I have no way to know. And it's
too complicated anyways, esp. for a fringe case that shouldn't exist in the
first place.
You need to log in before you can comment on or make changes to this bug.