Skip to content

wrong length check in is_valid_hostname_fqdn() #1

@raoulbhatia

Description

@raoulbhatia

hi!

in dns.inc.php, function is_valid_hostname_fqdn()

    $hostname = preg_replace("/\.$/","",$hostname);

    if (strlen($hostname) > 255) {
        error(ERR_DNS_HN_TOO_LONG);
        return false;
    }

i think that the length check is wrong because 255 includes the trailing dot.

please see
http://en.wikipedia.org/wiki/Domain_name#Domain_name_syntax and
http://en.wikipedia.org/wiki/Domain_name#cite_note-3

thank you,
raoul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions