<?php
 class vB_HumanVerify_Image extends vB_HumanVerify { protected bool $usestoken = true; public function verify_token($input, $action) { if (!is_array($input) OR empty($input['input'])) { $this->error = 'humanverify_missing'; return false; } $input['input'] = trim(str_replace(' ', '', $input['input'])); if ($this->delete_token($input['hash'], $input['input'])) { return true; } else { $this->error = 'humanverify_image_wronganswer'; return false; } } protected function fetch_answer() { return $this->fetch_answer_string(); } private function fetch_answer_string($length = 6) { $somechars = '234689ABCEFGHJMNPQRSTWY'; $morechars = '234689ABCEFGHJKMNPQRSTWXYZabcdefghjkmnpstwxyz'; $word = ''; for ($x = 1; $x <= $length; $x++) { $chars = ($x <= 2 OR $x == $length) ? $morechars : $somechars; $number = vbrand(1, strlen($chars)); $word .= substr($chars, $number - 1, 1); } return $word; } } 