Closed Bug 1116422 Opened 10 years ago Closed 10 years ago

urls without the http:// are ignored

Categories

(Other Applications Graveyard :: ChatZilla, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ewong, Assigned: Gijs)

Details

(Whiteboard: [cz-0.9.92])

Attachments

(1 file)

Entering www.foobar.com in cZ (0.99.1) and pressing enter does not output it to the chat. Completely ignores the input. Even if you type a whole line that includes www.<anything>.<anything> and it will still ignore what you entered. www.foo and foo.bar are ok. http:// needs to be prepended. Only then will it actually get sent.
The problem is with client.checkURLScheme. There was a change made to lowercase the url scheme. This throws an exception when the scheme is undefined. This case happens because replaceColorCodes calls checkURLScheme directly with the result of a regexp. What case will match the url regexp, but not be a url? Can we just skip the scheme check as should be handled elsewhere?
The linkRE will match things like foo:bar so we need to check that foo: is a URL scheme before turning it into a link. This was originally designed with the Mozilla platform's extensibility in mind, so it checks the registered protocol handlers in Components; we could probably just use a whitelist (in the RegExp) these days... but the quick fix is probably to do: if (scheme && !client.checkURLScheme(scheme)) return url; in replaceColorCodes().
Flags: needinfo?(gijskruitbosch+bugs)
Per comment 2...
Attachment #8548549 - Flags: review?(bugzilla-mozilla-20000923)
Assignee: rginda → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Flags: needinfo?(gijskruitbosch+bugs)
Comment on attachment 8548549 [details] [diff] [review] check for undefined scheme, Review of attachment 8548549 [details] [diff] [review]: ----------------------------------------------------------------- r=silver, sorry for the delays.
Attachment #8548549 - Flags: review?(bugzilla-mozilla-20000923) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.92]
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: