Fixed #58; also other minor bugs removed

This commit is contained in:
Pinga 2023-12-31 14:46:18 +02:00
parent 0a4afa6c98
commit dd17c0b873
8 changed files with 61 additions and 14 deletions

View file

@ -257,7 +257,7 @@ function extractDomainAndTLD($urlString) {
foreach ($testTlds as $testTld) {
if (str_ends_with($host, "$testTld")) {
// Handle the test TLD case
$tldLength = strlen($testTld) + 1; // +1 for the dot
$tldLength = strlen($testTld); // No +1 for the dot
$hostWithoutTld = substr($host, 0, -$tldLength);
$hostParts = explode('.', $hostWithoutTld);
$sld = array_pop($hostParts);