Page 1 of 1

[Fixed] Domain with a trailing dot: hiding rules won't apply

Posted: Sat Feb 11, 2012 8:48 pm
by famlam
Hi,

Not a very big bug as I doubt anyone will use trailing-dot-domain URLs, but worth mentioning:
If you visit http://torrentz.eu./ (or any random http URL and just append a dot to the domain) the following bugs can be found:
1. the EHH suggests the domain ""
2. the generated domain-specific filter from the EHH (foo.bar.##anything) won't apply to the page, (neither will foo.bar##anything).

Kind regards,
Famlam

Re: Domains with a trailing dot: hiding rules won't apply

Posted: Mon Feb 13, 2012 10:37 pm
by Wladimir Palant
The correct rule would be indeed "foo.bar.##anything" - Gecko treats "foo.bar." and "foo.bar" as different domains.

Now there are apparently two issues in how we are handling this domain name, will look into it.

Re: Domains with a trailing dot: hiding rules won't apply

Posted: Sat Jun 23, 2012 3:50 pm
by Wladimir Palant

Re: [Fixed] Domain with a trailing dot: hiding rules won't apply

Posted: Sat Jun 23, 2012 4:07 pm
by famlam
Thanks!

FYI, from your patch (line 1.87):

Code: Select all

if (this.ignoreTrailingDot)
  docDomain = docDomain.replace(/\.+$/, "").toUpperCase();
docDomain = docDomain.toUpperCase();
Shouldn't that be

Code: Select all

if (this.ignoreTrailingDot)
  docDomain = docDomain.replace(/\.+$/, "");
docDomain = docDomain.toUpperCase();
as you are uppercasing twice?

Re: [Fixed] Domain with a trailing dot: hiding rules won't apply

Posted: Sat Jun 23, 2012 4:59 pm
by Wladimir Palant
You are correct, thanks for noticing!

Fixed: https://hg.adblockplus.org/adblockplus/rev/db19b081bd9c