You are here

function honeypot_check_css in Honeypot 7

Check Honeypot's CSS file for a given Honeypot element name.

This function assumes the Honeypot CSS file already exists.

Parameters

string $element_name: The honeypot element class name (e.g. 'url').

Return value

bool TRUE if CSS is has element class name, FALSE if not.

1 call to honeypot_check_css()
honeypot_cron in ./honeypot.module
Implements hook_cron().

File

./honeypot.module, line 539
Honeypot module, for deterring spam bots from completing Drupal forms.

Code

function honeypot_check_css($element_name) {
  $path = honeypot_get_css_file_path();
  $handle = fopen($path, 'r');
  $contents = fread($handle, filesize($path));
  fclose($handle);
  if (strpos($contents, $element_name) === 1) {
    return TRUE;
  }
  return FALSE;
}