Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

bug(Parser): incorrect result of getRegistrableDomain() #14

Open
atypicalprogrammer opened this issue Jan 27, 2017 · 3 comments
Open

bug(Parser): incorrect result of getRegistrableDomain() #14

atypicalprogrammer opened this issue Jan 27, 2017 · 3 comments
Assignees

Comments

@atypicalprogrammer
Copy link

This doesn't seem to work for any blogspot subdomain..

test.blogspot.com gives as registrable domain: test.blogspot.com

test.github.com gives as registrable domain: github.com

I don't understand how it would work that way?

@layershifter
Copy link
Owner

Hi @atypicalprogrammer

TLDExtract uses TLDDatabase which uses PublicSuffix List as single source of truth. PSL has two sections: ICANN and private domains. So, when you set TLDExtract's parsing mode it operates with determined sections.

blogspot.com is defined in private section, so it's private domain. If don't need private domains in your result, you need to set parsing mode:

$extract = new Extract(null, null, Extract::MODE_ALLOW_ICCAN);
$result = $extract->parse('test.github.com');
// of in fuction
tld_extract('test.github.com', Extract::MODE_ALLOW_ICCAN);

Howerer, I agree that getRegistrableDomain() returns an incorrect result without parsing options, it's a priority issue for next major version.

@layershifter layershifter changed the title Blogspot bug(Parser): incorrect result of getRegistrableDomain() Jan 27, 2017
@layershifter layershifter added this to the 2.0 milestone Jan 27, 2017
@layershifter layershifter self-assigned this Jan 27, 2017
@dgram
Copy link

dgram commented Jan 31, 2017

hi,

there are also some other domains falsley valid.
ex.: #test.com or test.com#test_test

->isValidDomain() gives me true for both, and also in the ->getRegistrableDomain() i get the false domain

regards

@layershifter
Copy link
Owner

@dgram Thanks, I opened #15 for this.

@layershifter layershifter removed this from the 2.0 milestone Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants