Skip to content

Wrong ut_tld and ut_domain if a valid TLD is in the middle of the string but not at the end #14

@teresachila

Description

@teresachila

Example: 1.something.com.local
This is not a valid domain, however, since "com" is in the middle of the string, it returns "com" as ut_tld and "l.com" as ut_domain. It should return None instead.

Suggested fix:
In ut_parse_lib.py, under the findTLD() function, add the following check right before returning TLD:

    if (len(items)>0 and items[-1]!=parts[-1]):
         # the TLD is not found at the end of the string, not a valid TLD
         TLD=None

Metadata

Metadata

Assignees

Labels

duplicateThis issue or pull request already exists

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions