Swift_Plugins_RedirectingPlugin::_isWhitelisted PHP Method

_isWhitelisted() protected method

Matches address against whitelist of regular expressions.
protected _isWhitelisted ( $recipient ) : boolean
$recipient
return boolean
    protected function _isWhitelisted($recipient)
    {
        if (in_array($recipient, (array) $this->_recipient)) {
            return true;
        }
        foreach ($this->_whitelist as $pattern) {
            if (preg_match($pattern, $recipient)) {
                return true;
            }
        }
        return false;
    }