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

Mail_RFC822::_validateLocalPart ( local_part )

Function to validate the local part of an address: local-part = word *("." word)

private

Parameters:
string$local_part
Returns:
mixed False on failure, or the validated local part on success.

Definition at line 859 of file z_RFC822.php.

References _splitCheck(), and _validatePhrase().

Referenced by _validateAddrSpec().

    {
        $parts = explode('.', $local_part);
        $words = array();

        // Split the local_part into words.
        while (count($parts) > 0){
            $words[] = $this->_splitCheck($parts, '.');
            for ($i = 0; $i < $this->index + 1; $i++) {
                array_shift($parts);
            }
        }

        // Validate each word.
        foreach ($words as $word) {
            // If this word contains an unquoted space, it is invalid. (6.2.4)
            if (strpos($word, ' ') && $word[0] !== '"')
            {
                return false;
            }

            if ($this->_validatePhrase(trim($word)) === false) return false;
        }

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

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