Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whois $ rdap error Invalid TLD. Please search only allowed TLDs #178

Open
wvro-org opened this issue Oct 9, 2024 · 4 comments
Open

Whois $ rdap error Invalid TLD. Please search only allowed TLDs #178

wvro-org opened this issue Oct 9, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@wvro-org
Copy link
Contributor

wvro-org commented Oct 9, 2024

TLDs in system(db) and ofcourse in 'Test TLDs=' just one for example ->
test0.example.com
created domain t1.test0.example.com
t1.test0.example.com -> whois Invalid TLD. Please search only allowed TLDs / rdap -> Error: Invalid TLD. Please search only allowed TLDs
that's becuse supposedly system requires that example.com be present in TLDs (db domain_tld)
->
checked when example.com is added as TLD... whois and rdap works fine ....
please fix it ....
To my mind from one point of view it could be viewed as a security fiture , from other as a bug ....

@getpinga getpinga self-assigned this Nov 1, 2024
@getpinga getpinga added the question Further information is requested label Nov 1, 2024
@getpinga
Copy link
Contributor

getpinga commented Nov 1, 2024

Please clarify or give another example as I'm unable to reproduce. From what I understand, you want to change the error message or?

@wvro-org
Copy link
Contributor Author

wvro-org commented Nov 6, 2024

Assuming clean install ... all "test" data deleted.... (.test TLDs and so on)
TLDs
.3rdlvl.example2rdlv.com -> example2rdlv.com NOT added as TLD
.3rdlvl.example.com -> example.com added as TLD too...

/var/www/cp/.env -> TEST_TLDS=.3rdlvl.example2rdlv.com,.3rdlvl.example.com,.example.com

test1.3rdlvl.example2rdlv.com are 'registered' no errors
test1.3rdlvl.example.com are 'registered' no errors

whois web and p 43
test1.3rdlvl.example2rdlv.com -> {"error":"Invalid TLD. Please search only allowed TLDs"}
test1.3rdlvl.example.com -> NO errrors

rdap
test1.3rdlvl.example2rdlv.com -> {"error":"Invalid TLD. Please search only allowed TLDs"}
test1.3rdlvl.example.com -> NO errrors

the error {"error":"Invalid TLD. Please search only allowed TLDs"} is becouse main domain (example.com) is required too....

NOTE
TLDs are added normally without any erros
if your try 'edit' tld in tlds
3rdlvl.example2rdlv.com -> error Invalid TLD format

to 'fix' Invalid TLD format (No need to actually fix this //doesn't allow 3rd lvl tlds// Invalid TLD format in new version)

SystemController.php

line 593
if (!preg_match('/^.(xn--[a-zA-Z0-9-]+|[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)?)$/', $args)) {
$this->container->get('flash')->addMessage('error', 'Invalid TLD format');
return $response->withHeader('Location', '/registry/tlds')->withStatus(302);
} //doesn't allow 3rd lvl tlds
-> if (!preg_match('/^.(xn--[a-zA-Z0-9-]+|[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*.?[a-zA-Z0-9-]+)$/', $args)) {
$this->container->get('flash')->addMessage('error', 'Invalid TLD format');
return $response->withHeader('Location', '/registry/tlds')->withStatus(302);
}

and line 886 if (!preg_match('/^.(xn--[a-zA-Z0-9-]+|[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)?)$/', $args)) {
$this->container->get('flash')->addMessage('error', 'Invalid TLD format');
return $response->withHeader('Location', '/registry/tlds')->withStatus(302);
} //doesn't allow 3rd lvl tlds

                  if (!preg_match('/^\.([a-z\d-]+(\.[a-z\d-]+)*|\[a-z\d-\]+(\.-[a-z\d-]+)?)(\.[a-z\d-]{2,})$/', $args)) {
        $this->container->get('flash')->addMessage('error', 'Invalid TLD format');
        return $response->withHeader('Location', '/registry/tlds')->withStatus(302);
    }

@getpinga
Copy link
Contributor

I think I got it and it's fixed in 1.0.8, thank you. Please reopen if you still experience it.

@getpinga
Copy link
Contributor

Sorry, its fixed only in CP.

@getpinga getpinga reopened this Nov 25, 2024
@getpinga getpinga added bug Something isn't working and removed question Further information is requested labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants