public function isAllowed($entry, $defaultState)
    {
        $whited  = false;
        $blacked = false;

        if (is_array($this->lists)) {
            foreach ($this->lists as $list) {
                $allowed = $list->isAllowed($entry);
                if ($allowed !== null) {
                    if ($allowed) {
                        $whited = true;
                    } else {
                        $blacked = true;
                    }
                }
            }
        }

        return ($defaultState ? (!$blacked || $whited) : ($whited && !$blacked));
    }
public function isAllowed($entry, $defaultState)
    {
        $whited  = false;
        $blacked = false;

        if (is_array($this->lists)) {
            foreach ($this->lists as $list) {
                $allowed = $list->isAllowed($entry);
                if ($allowed !== null) {
                    if ($allowed) {
                        $whited = true;
                    } else {
                        $blacked = true;
                    }
                }
            }
        }

        return ($defaultState ? (!$blacked || $whited) : ($whited && !$blacked));
    }
public function isAllowed ( $ entry , $ defaultState ) { $ whited = false ; $ blacked = false ; if ( is_array ( $ this -> lists ) ) { foreach ( $ this -> lists as $ list ) { $ allowed = $ list -> isAllowed ( $ entry ) ; if ( $ allowed !== null ) { if ( $ allowed ) { $ whited = true ; } else { $ blacked = true ; } } } } return ( $ defaultState ? ( ! $ blacked || $ whited ) : ( $ whited && ! $ blacked ) ) ; }
Check if a string is allowed

@param string  $entry        String to compare
@param boolean $defaultState Default value

@return boolean
Check if a string is allowed