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

Mail_RFC822::_splitCheck ( parts,
char 
)

A common function that will check an exploded string.

private

Parameters:
array$partsThe exloded string.
string$charThe char that was exploded on.
Returns:
mixed False if the string contains unclosed quotes/brackets, or the string on success.

Definition at line 318 of file z_RFC822.php.

References _hasUnclosedBrackets(), and _hasUnclosedQuotes().

Referenced by _isGroup(), _splitAddresses(), _validateAddress(), _validateAddrSpec(), _validateDomain(), _validateLocalPart(), _validatePhrase(), _validateRouteAddr(), and validateMailbox().

    {
        $string = $parts[0];

        for ($i = 0; $i < count($parts); $i++) {
            if ($this->_hasUnclosedQuotes($string)
                || $this->_hasUnclosedBrackets($string, '<>')
                || $this->_hasUnclosedBrackets($string, '[]')
                || $this->_hasUnclosedBrackets($string, '()')
                || substr($string, -1) == '\\') {
                if (isset($parts[$i + 1])) {
                    $string = $string . $char . $parts[$i + 1];
                } else {
                    $this->error = 'Invalid address spec. Unclosed bracket or quotes';
                    return false;
                }
            } else {
                $this->index = $i;
                break;
            }
        }

        return $string;
    }

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