You are here

protected function RateBotDetector::checkAgent in Rate 8

Check if the given user agent matches the local bot database.

Return value

bool True if match found; false otherwise.

1 call to RateBotDetector::checkAgent()
RateBotDetector::checkIsBot in src/RateBotDetector.php
Check if the current user is blocked.

File

src/RateBotDetector.php, line 129

Class

RateBotDetector
The rate.bot_detector service.

Namespace

Drupal\rate

Code

protected function checkAgent() {
  $sql = 'SELECT 1 FROM {rate_bot_agent} WHERE :agent LIKE pattern LIMIT 1';
  return (bool) $this->database
    ->query($sql, [
    ':agent' => $this->agent,
  ])
    ->fetchField();
}