public function isEmailBanned($email)
    {
        if (! $this->dbh->query("SHOW TABLES LIKE '{$this->config->table_emails_banned}'")->fetchAll() ) {
            return false;
        };

        $query = "SELECT count(*) FROM {$this->config->table_emails_banned} WHERE domain = :domain";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute([
            'domain' => (strtolower(explode('@', $email)[1]))
        ]);

        if ($query_prepared->fetchColumn() == 0) {
            return false;
        }

        return true;
    }
public function isEmailBanned($email)
    {
        if (! $this->dbh->query("SHOW TABLES LIKE '{$this->config->table_emails_banned}'")->fetchAll() ) {
            return false;
        };

        $query = "SELECT count(*) FROM {$this->config->table_emails_banned} WHERE domain = :domain";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute([
            'domain' => (strtolower(explode('@', $email)[1]))
        ]);

        if ($query_prepared->fetchColumn() == 0) {
            return false;
        }

        return true;
    }
public function isEmailBanned ( $ email ) { if ( ! $ this -> dbh -> query ( "SHOW TABLES LIKE '{$this->config->table_emails_banned}'" ) -> fetchAll ( ) ) { return false ; } ; $ query = "SELECT count(*) FROM {$this->config->table_emails_banned} WHERE domain = :domain" ; $ query_prepared = $ this -> dbh -> prepare ( $ query ) ; $ query_prepared -> execute ( [ 'domain' => ( strtolower ( explode ( '@' , $ email ) [ 1 ] ) ) ] ) ; if ( $ query_prepared -> fetchColumn ( ) == 0 ) { return false ; } return true ; }
Checks if an email is banned
@param string $email
@return boolean
Checks if an email is banned