You are here

public static function HttpblResponse::buildHoneypot in http:BL 8

Create a (standalone) Honeypot link.

Return value

string $honeypot

Overrides HttpblResponseInterface::buildHoneypot

3 calls to HttpblResponse::buildHoneypot()
HttpblResponse::buildHttpblResponse in src/HttpblResponse.php
Build a new HttpblResponse based on evaluation status.
HttpblResponse::challengeFailureBlacklisted in src/HttpblResponse.php
Build a response to a white-list challenge failure.
HttpblResponse::challengeFailurePurgatory in src/HttpblResponse.php
Build a response to a white-list challenge failure.

File

src/HttpblResponse.php, line 151

Class

HttpblResponse
HttpblResponse builds the final response to request.

Namespace

Drupal\httpbl

Code

public static function buildHoneypot() {
  if (\Drupal::state()
    ->get('httpbl.footer') ?: FALSE) {
    $link = \Drupal::state()
      ->get('httpbl.link') ?: NULL;
    $word = \Drupal::state()
      ->get('httpbl.word') ?: 'randomness';
    $honeypot = self::httpbl_honeylink($link, $word);
    if (!empty($honeypot)) {
      return $honeypot;
    }
  }
  return "";
}