Closed
Bug 223681
Opened 21 years ago
Closed 12 years ago
[mozTXTToHTMLConv] fails for links with ipv6 addresses
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(thunderbird12-)
RESOLVED
FIXED
Thunderbird 15.0
Tracking | Status | |
---|---|---|
thunderbird12 | - | --- |
People
(Reporter: Biesinger, Assigned: mkmelin)
References
Details
Attachments
(2 files, 1 obsolete file)
7.28 KB,
patch
|
BenB
:
review+
Biesinger
:
superreview+
|
Details | Diff | Splinter Review |
3.78 KB,
message/rfc822
|
Details |
I got bugmail about an IPv6 bug, it contained an address like this: http://[2001:200:0:8002:203:47ff:fea5:3085]/ mailnews turned that into a link pointing to: http://[2001:200/ the link should've pointed to the entire ip address.
Comment 1•21 years ago
|
||
I'm not sure, but I suspect the problem to be in Necko. IIRC, the converter should make the link text identical to the URL found. So, I guess the difference comes from the URL parser stripping a part. Somebody would have to confirm that by adding printf statements or using a debugger (I personally don't care enough).
Summary: automatic "linkifier" fails for ipv6 addresses → [mozTXTToHTMLConv] fails for ipv6 addresses
Comment 2•21 years ago
|
||
Actually, the last ] is not made part of the URL, so that's probably why Necko fails (assuming it does). However, ] and [ are disallowed in URLs, IIRC, per RFC2396. So, is this a valid URL in the first place? If so who says that and how does fit with RFC2396?
Reporter | ||
Comment 3•21 years ago
|
||
http://www.faqs.org/rfcs/rfc2732.html " This document updates the generic syntax for Uniform Resource Identifiers defined in RFC 2396 [URL]. It defines a syntax for IPv6 addresses and allows the use of "[" and "]" within a URI explicitly for this reserved purpose."
Reporter | ||
Comment 4•21 years ago
|
||
and yes, a missing ] would cause this: js> uri = ios.newURI("http://[200:1:2:3", "", null); [xpconnect wrapped nsIURI] js> uri.spec http://[200:1/ js> uri = ios.newURI("http://[200:1:2:3]", "", null); [xpconnect wrapped nsIURI] js> uri.spec http://[200:1:2:3]/
Comment 5•21 years ago
|
||
> http://www.faqs.org/rfcs/rfc2732.html OK, thanks, that explains it. Is there a place where I can see which RFCs update a certain RFC? > and yes, a missing ] would cause this Yes, not Necko's fault. So, the converter needs an update. Either we allow [] only for this purpose, as the RFC says, but that could need a chunk of code, or we allow [] generally, slightly against the RFC.
Summary: [mozTXTToHTMLConv] fails for ipv6 addresses → [mozTXTToHTMLConv] fails for links with ipv6 addresses
Reporter | ||
Comment 6•21 years ago
|
||
> Is there a place where I can see which RFCs update a certain RFC?
sorry... don't know
Comment 7•21 years ago
|
||
http://www.ietf.org/iesg/1rfc_index.txt contains information about which RFCs update other RFCs, but it is incomplete. I have sent email to the RFC editor asking for this particular reference to be added to the RFC index.
Comment 8•21 years ago
|
||
So, this bug should be reassigned to Necko? Or should a dependent bug be filed?
Reporter | ||
Comment 9•21 years ago
|
||
john: as comment 5 says "Yes, not Necko's fault.", necko would be the wrong component for this bug
Comment 10•21 years ago
|
||
Where would this change have to be made? A simple regex match like \[A-Fa-f0-9:\]{0,40} should catch most cases...
Comment 11•21 years ago
|
||
Oops, I thought it was JS code, not C++. Maybe PR_StringToNetAddr could be used instead...
Updated•20 years ago
|
Product: Browser → Seamonkey
Comment 12•20 years ago
|
||
Moving a bunch of mozTXTToHTMLConv bugs into Core / MailNews Backend to live with their bretheren.
Updated•20 years ago
|
Component: MailNews: Main Mail Window → MailNews: Backend
Product: Mozilla Application Suite → Core
Comment 13•17 years ago
|
||
sorry for the spam. making bugzilla reflect reality as I'm not working on these bugs. filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Assignee | ||
Updated•17 years ago
|
OS: Linux → All
QA Contact: esther → backend
Hardware: PC → All
Updated•16 years ago
|
Product: Core → MailNews Core
Comment 16•12 years ago
|
||
Probably a bit late for TB12, but this year will see the launch of ipv6 (in June) Wondering if we should fix this by then.
tracking-thunderbird12:
--- → ?
Comment 17•12 years ago
|
||
Not tracking for 12, though we would like to see this fixed.
Flags: wanted-thunderbird+
Assignee | ||
Comment 18•12 years ago
|
||
Taking. BenB: I have a vague recollection you have some mail where most url variants are shown, kind of a manual test? That could be useful for creating an automated test where most versions would be checked.
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Assignee | ||
Comment 19•12 years ago
|
||
Allow IPv6 addresses, add some tests.
Attachment #618778 -
Flags: review?(ben.bucksch)
Comment 20•12 years ago
|
||
Magnus, thanks for the nice patch. I'm mostly OK with it. 2 comments: - Please avoid making changes that are not needed for the fix, e.g. the "else return false;" and the spaces. These things are there quite intentionally. - Minor: Please make a comment after "seenOpeningParenthesis" // there is a ( in the URL ditto for [ , to make this more readable for non-English speakers like me. Apart from that, r=BenB Thanks!
Assignee | ||
Comment 21•12 years ago
|
||
Adding the comment. Well, no else after return is a mozilla coding style rule, i just took the opportunity to fix it since i was touching code next by - i do think overall readability of the method is important. Re the 3-7 spaces before parenthesis i don't know why they were there, but if it's supposed to be some kind of styling its different from rest of the code as well as code in general.
Attachment #618778 -
Attachment is obsolete: true
Attachment #623411 -
Flags: review?(ben.bucksch)
Attachment #618778 -
Flags: review?(ben.bucksch)
Assignee | ||
Updated•12 years ago
|
Attachment #623411 -
Attachment description: proposed fix v2 (for checkin) → proposed fix v2
Comment 22•12 years ago
|
||
> i do think overall readability of the method is important.
I agree, and I think if (foo) return 1; else return 2; is more readable.
You still haven't removed this change. Please do.
Assignee | ||
Comment 23•12 years ago
|
||
Ben: https://developer.mozilla.org/En/Mozilla_Coding_Style_Guide item #1 "Don't put an else right after a return. Delete the else, it's unnecessary and increases indentation level." (Yes there are other places where it should be fixed too, but this happened to be in close by, i'm not so keen on making a style cleanup patch for the whole file.)
Comment 24•12 years ago
|
||
Magnus is right; the style rules are quite clear on that.
Updated•12 years ago
|
Attachment #623411 -
Flags: review?(ben.bucksch) → review+
Assignee | ||
Updated•12 years ago
|
Attachment #623411 -
Flags: superreview?(cbiesinger)
Reporter | ||
Comment 25•12 years ago
|
||
Comment on attachment 623411 [details] [diff] [review] proposed fix v2 sorry for the delay!
Attachment #623411 -
Flags: superreview?(cbiesinger) → superreview+
Comment 26•12 years ago
|
||
Magnus, in comment 18, you asked for my old testcases. Sorry for the delay. Attached here, as RFC822 message file. I don't expect any problems, but would be nice to 1) check them before commit and 2) add them to the unit test that you added. Thanks for the unit test, BTW!
Assignee | ||
Comment 27•12 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/58227b467522
Flags: in-testsuite+
Target Milestone: --- → Thunderbird 15.0
Comment 28•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/58227b467522
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•