original_string: protected function passFromDb($macHash, $hash, $time)
      {
          $database = DatabaseProvider::getDb();
          $where = "where oxid = " . $database->quote($macHash) . " and oxhash = " . $database->quote($hash);
          $query = "select 1 from oecaptcha " . $where;
          $pass = (bool) $database->getOne($query, false, false);
  
          if ($pass) {
              // cleanup
              $query = "delete from oecaptcha " . $where;
              $database->execute($query);
          }
  
          // garbage cleanup
          $query = "delete from oecaptcha where oxtime < $time";
          $database->execute($query);
  
          return $pass;
      }
code: protected function passFromDb($macHash, $hash, $time)
      {
          $database = DatabaseProvider::getDb();
          $where = "where oxid = " . $database->quote($macHash) . " and oxhash = " . $database->quote($hash);
          $query = "select 1 from oecaptcha " . $where;
          $pass = (bool) $database->getOne($query, false, false);
  
          if ($pass) {
              // cleanup
              $query = "delete from oecaptcha " . $where;
              $database->execute($query);
          }
  
          // garbage cleanup
          $query = "delete from oecaptcha where oxtime < $time";
          $database->execute($query);
  
          return $pass;
      }
code_tokens: protected function passFromDb ( $ macHash , $ hash , $ time ) { $ database = DatabaseProvider :: getDb ( ) ; $ where = "where oxid = " . $ database -> quote ( $ macHash ) . " and oxhash = " . $ database -> quote ( $ hash ) ; $ query = "select 1 from oecaptcha " . $ where ; $ pass = ( bool ) $ database -> getOne ( $ query , false , false ) ; if ( $ pass ) { // cleanup $ query = "delete from oecaptcha " . $ where ; $ database -> execute ( $ query ) ; } // garbage cleanup $ query = "delete from oecaptcha where oxtime < $time" ; $ database -> execute ( $ query ) ; return $ pass ; }
docstring: Checks for DB captcha hash validity
  
  @param int    $macHash hash key
  @param string $hash    captcha hash
  @param int    $time    check time
  
  @return bool
docstring_tokens: Checks for DB captcha hash validity