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

Mail_RFC822::_validateRouteAddr ( route_addr )

This function validates a route-addr which is: route-addr = "<" [route] addr-spec ">"

Angle brackets have already been removed at the point of getting to this function.

private

Parameters:
string$route_addrThe string to check.
Returns:
mixed False on failure, or an array containing validated address/route information on success.

Definition at line 693 of file z_RFC822.php.

References _splitCheck(), _validateAddrSpec(), and _validateRoute().

Referenced by validateMailbox().

    {
        // Check for colon.
        if (strpos($route_addr, ':') !== false) {
            $parts = explode(':', $route_addr);
            $route = $this->_splitCheck($parts, ':');
        } else {
            $route = $route_addr;
        }

        // If $route is same as $route_addr then the colon was in
        // quotes or brackets or, of course, non existent.
        if ($route === $route_addr){
            unset($route);
            $addr_spec = $route_addr;
            if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
                return false;
            }
        } else {
            // Validate route part.
            if (($route = $this->_validateRoute($route)) === false) {
                return false;
            }

            $addr_spec = substr($route_addr, strlen($route . ':'));

            // Validate addr-spec part.
            if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
                return false;
            }
        }

        if (isset($route)) {
            $return['adl'] = $route;
        } else {
            $return['adl'] = '';
        }

        $return = array_merge($return, $addr_spec);
        return $return;
    }

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