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

Posting here is no longer possible, please use the corresponding product forum.
Locked
famlam
Posts: 59
Joined: Sat Aug 07, 2010 2:06 pm

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

Post 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
Wladimir Palant

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

Post 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.
famlam
Posts: 59
Joined: Sat Aug 07, 2010 2:06 pm

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

Post 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?
Wladimir Palant

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

Post by Wladimir Palant »

You are correct, thanks for noticing!

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