I read the URL you provided, and a lot of assumptions were made, but a full range of tests weren't applied.

The example given in the last post is to use the escaped version of open and close parens, which are %28 and %29. RFC 2396 explicitly states that open/close paren are not considered reserved characters, thus they should not be escaped (escaped in English means "converted into those funky %xx sequences"). So using %28 and %29, although gets handled by URI parsers just fine, is not adherent to the RFC. If you want double confirmation of this, I'll be glad to show it with some perl scripting using URI::Escape, which is RFC-compliant:

Code:
use URI::Escape;
print uri_escape("http://blahblah.com/(keke)");
print "\n";


results in:

Code:
http%3A%2F%2Fblahblah.com%2F(keke)


This is because colon (:) and solidus (/) are deemed reserved according to RFC 2396. Note, however, that ( and ) are not escaped.

Now that I've covered that base, back to the core problem.

mIRC is trying to be "smart" about removing parenthesis for URLs, which is where the problem lies. The logic is broken, as I'll show below. Here's a chart of what mIRC does (tested/confirmed):

Code:
mIRC string                    Browser URL
http://blahblah.com/keke       http://blahblah.com/keke
http://blahblah.com/keke)      http://blahblah.com/keke
http://blahblah.com/(keke)     http://blahblah.com/(keke
(http://blahblah.com/keke)     http://blahblah.com/keke
(http://blahblah.com/(keke))   http://blahblah.com/(keke)
(http://blahblah.com/((keke))  http://blahblah.com/((keke)


The 2nd and 3rd examples are downright wrong (bugs). The trailing paren is being removed erroneously in the 2nd example, and the same for the 3rd example.

The code should be changed to only remove the initial and trailing parens if they both exist, and are the first and last characters of the string respectively. This is what mIRC is *trying* to do, but is broken.

Proper behaviour would be:

Code:
mIRC string                    Browser
http://blahblah.com/keke       http://blahblah.com/keke
http://blahblah.com/keke)      http://blahblah.com/keke)
http://blahblah.com/(keke)     http://blahblah.com/(keke)
(http://blahblah.com/keke)     http://blahblah.com/keke
(http://blahblah.com/(keke))   http://blahblah.com/(keke)
(http://blahblah.com/((keke))  http://blahblah.com/((keke)


Have I made this issue clear enough? :-) It's a bug.

Last edited by koitsu; 11/05/07 03:22 AM.