Logo Search packages:      
Sourcecode: d-push version File versions  Download package

Mail_RFC822::_validateDomain ( domain )

Function to validate a domain, though this is not quite what you expect of a strict internet domain.

domain = sub-domain *("." sub-domain)

private

Parameters:
string$domainThe string to check.
Returns:
mixed False on failure, or the validated domain on success.

Definition at line 766 of file z_RFC822.php.

References _splitCheck(), and _validateSubdomain().

Referenced by _validateAddrSpec(), and _validateRoute().

    {
        // Note the different use of $subdomains and $sub_domains
        $subdomains = explode('.', $domain);

        while (count($subdomains) > 0) {
            $sub_domains[] = $this->_splitCheck($subdomains, '.');
            for ($i = 0; $i < $this->index + 1; $i++)
                array_shift($subdomains);
        }

        foreach ($sub_domains as $sub_domain) {
            if (!$this->_validateSubdomain(trim($sub_domain)))
                return false;
        }

        // Managed to get here, so return input.
        return $domain;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index