Closed Bug 218287 Opened 21 years ago Closed 17 years ago

[mozTXTToHTMLConv] '[' in message body should not be included by URL recognition (or should be escaped)

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dunkel, Assigned: BenB)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030901
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030901

Receiving emails from Phorum scripts, where Phorum-codes are used in order to
represent and handle pseudo-HTML code, I find kind of damaged URL links because
the URL filter accepts "[" as part of an URL.

Here is an example email which I reveiced from our Phorum:
---snip---
This message was sent from: Calamus-Forum (de).
<http://www.calamus.net/phorum/read.php?f=1&i=5544&t=5525> 
----------------------------------------------------------------

[i]Jede/r kann Calamus und Calamus-Module als Händler verkaufen.[/i]
Nee, da hast Du mich missverstanden. Ich meinte etwas in der Art...

[img]http://www.uni-duisburg.de/~hg262kr/images/pramien.gif[/img]

Nur bekommt man für einen geworbenen SL-Neukunden halt keinen Staubsauger,
sondern ein schnuckliges Modul (evtl. auch mit Zuzahlung).

----------------------------------------------------------------
Sent using Phorum software version 3.4.4 <http://phorum.org> 
---snap---

If you are not familiar with Phorum: The [xxx] tags are Phorum-code and are
translated into real HTML code in the web page. You will see this when you
follow the mentioned link http://www.calamus.net/phorum/read.php?f=1&i=5544&t=5525.

But in the email, the line 

[img]http://www.uni-duisburg.de/~hg262kr/images/pramien.gif[/img]

is filtered as an URL with a wrong length because of the accepted "[" sign.

You will see
[img]http://www.uni-duisburg.de/~hg262kr/images/pramien.gif[/img
highlighted in your Mail body when you receive this mail.

Reproducible: Always

Steps to Reproduce:



Expected Results:  
The URL filter should not accept "[" as part of a valid URL like it does already
with "]".
Oh, great. This bugzilla engine shows the bug which I wanted to show you, too. :-) 

Should be easy to fix. ;-) Good luck, guys.
The thing is, '[' and ']' are legal file characters.
Mike, you claim that "[" and "]" are valid URL characters.
Please tell me about two things:

a) Why does Mozilla NOT use ] as part of the URL in my example?
b) Why does http://www.ietf.org/rfc/rfc2396.txt tell that these characters are
unwise and have to be escaped in order to be used?

Trust me, they are WRONG in URL's. ;-)
OK, I agree.  I couldn't find a dupe, so confirming.  Updating summary a bit.

See bug 133016 (esp. bug 133016 comment 18), also bug 119963.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: [ in message body should not be part of href' in URL links → [mozTXTToHTMLConv] '[' in message body should not be included by URL recognition (or should be escaped)
Yes, []<> are illegal in URLs.

You provided a good, practical reason to fix this, thanks.

Should be easy, just add the opening brackets to the chars that end a url (and
vise versa, probably). Will fix the next time when I am in the code (which can
be a long time, though :( ).
Assignee: sspitzer → ben.bucksch
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
dunkel@calamus.net, why did you close this as WFM? This bug exists for me (at
least in 1.4.x, and I am not aware of changes).
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Ben Buksch:
What do you mean with "1.4.x"? Are you talking about Mozilla 1.4.x???

I tested it with Mozilla 1.8a2 (Build ID 20040523) and it works fine here for
me. This is, why I have chosen WORKSFORME.
Me again. Damned, damned, damned. :-)

I was totally wrong. Mozilla 1.8a2 works fine recognizing "]" but the "["
problem is still existing. Thank you for your attention, Ben Buksch!
Product: MailNews → Core
Moving a bunch of mozTXTToHTMLConv bugs into Core / MailNews Backend to live 
with their bretheren.
Component: MailNews: Filters → MailNews: Backend
Recognition probably should stop at '\' and '^' as well; both are in the 
"unwise" list of delimiters at RFC 2396.
This got fixed with bug 133016 (attachment 254729 [details] [diff] [review]). 

We should file a new bug for '\' and '^' if there isn't one already.
Status: REOPENED → RESOLVED
Closed: 20 years ago17 years ago
OS: Windows 2000 → All
Priority: P3 → --
QA Contact: laurel → backend
Hardware: PC → All
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.