Skip to content

Commit

Permalink
Fixed invalid variable causing error while accessing `/logdata/cashpo…
Browse files Browse the repository at this point in the history
…ints` (#187)

* Fixes #186
  • Loading branch information
cydh authored and Akkarinage committed Jun 19, 2018
1 parent 2ded5f8 commit 43249c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/logdata/cashpoints.php
Expand Up @@ -20,29 +20,29 @@
if ($logs) {
$charIDs = array();
$pickTypes = Flux::config('PickTypes');

foreach ($logs as $log) {
$charIDs[$log->char_id] = null;

if ($log->type == 'M') {
$mobIDs[$log->src_id] = null;
}
else {
$srcIDs[$log->src_id] = null;
}

$log->pick_type = $pickTypes->get($log->type);
}

if ($charIDs || $srcIDs) {
$charKeys = array_keys($charIDs);
$search = implode(',', array_fill(0, count($charKeys), $charKeys));

$search = implode(',', array_fill(0, count($charKeys), '?'));
$sql = "SELECT char_id, name FROM {$server->charMapDatabase}.`char` ";
$sql .= "WHERE char_id IN (".$search.")";
$sth = $server->connection->getStatement($sql);
$sth->execute();
$sth->execute($charKeys);

$ids = $sth->fetchAll();

// Map char_id to name.
Expand Down

0 comments on commit 43249c2

Please sign in to comment.