diff --git a/.travis.yml b/.travis.yml index 3e25b1d0..ccb4ec80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,5 @@ language: php php: - - '5.5' - '5.6' - - '7.0' - - hhvm - - nightly script: make test diff --git a/conf/sample.config.inc.php b/conf/sample.config.inc.php index fe51fbb4..6b88f2fa 100644 --- a/conf/sample.config.inc.php +++ b/conf/sample.config.inc.php @@ -32,7 +32,7 @@ * one you want to report on. * */ - + foreach(glob("conf/datasource_*.inc.php") as $datasource) { require_once($datasource); } @@ -345,7 +345,7 @@ 'callbacks' => array( 'table' => array( 'date' => function ($x) { $type=''; if ( date('N',strtotime($x)) >= 6) { $type = 'weekend'; } return array($x,$type); }, - 'checksum' => function ($x) { return array(dec2hex($x), ''); } + // 'checksum' => function ($x) { return array(dec2hex($x), ''); } ) ) diff --git a/lib/Anemometer.php b/lib/Anemometer.php index 6b14f51d..37af4b2e 100644 --- a/lib/Anemometer.php +++ b/lib/Anemometer.php @@ -368,7 +368,8 @@ private function translate_checksum($checksum) } else if (preg_match('/^[0-9A-Fa-f]+$/', $checksum)) { - return $this->bchexdec($checksum); + //return $this->bchexdec($checksum); + return $checksum; } else if (strlen($checksum) == 0) { diff --git a/lib/AnemometerModel.php b/lib/AnemometerModel.php index 1742792f..19150730 100644 --- a/lib/AnemometerModel.php +++ b/lib/AnemometerModel.php @@ -198,7 +198,7 @@ public function get_reviewers() { */ public function checksum_exists($checksum) { $checksum_field_name = $this->get_field_name('checksum'); - $query = "SELECT `{$checksum_field_name}` FROM `{$this->fact_table}` WHERE `{$checksum_field_name}`=" . $this->mysqli->real_escape_string($checksum); + $query = "SELECT `{$checksum_field_name}` FROM `{$this->fact_table}` WHERE `{$checksum_field_name}`='" . $this->mysqli->real_escape_string($checksum). "'"; $result = $this->mysqli->query($query); check_mysql_error($result, $this->mysqli); if ($result->num_rows) { @@ -227,7 +227,7 @@ function ($x, $y) use ($mysqli) { }, array_keys($fields), array_values($fields) ) ); - $sql .= " WHERE `{$checksum_field_name}`=" . $this->mysqli->real_escape_string($checksum); + $sql .= " WHERE `{$checksum_field_name}`='" . $this->mysqli->real_escape_string($checksum) . "'"; $res = $this->mysqli->query($sql); // @todo ... fix this by making it a local method check_mysql_error($res, $this->mysqli); @@ -241,7 +241,7 @@ function ($x, $y) use ($mysqli) { */ public function get_query_by_checksum($checksum) { $checksum_field_name = $this->get_field_name('checksum'); - $result = $this->mysqli->query("SELECT * FROM `{$this->fact_table}` WHERE `{$checksum_field_name}`={$checksum}"); + $result = $this->mysqli->query("SELECT * FROM `{$this->fact_table}` WHERE `{$checksum_field_name}`='{$checksum}'"); check_mysql_error($result, $this->mysqli); if ($row = $result->fetch_assoc()) { return $row; @@ -265,7 +265,7 @@ public function get_query_samples($checksum, $limit = 1, $offset = 0) { { $table = $this->fact_table; } - $sql = "SELECT * FROM `{$table}` WHERE `{$checksum_field_name}`={$checksum} ORDER BY `{$time_field_name}` DESC LIMIT {$limit} OFFSET {$offset}"; + $sql = "SELECT * FROM `{$table}` WHERE `{$checksum_field_name}`='{$checksum}' ORDER BY `{$time_field_name}` DESC LIMIT {$limit} OFFSET {$offset}"; return $this->mysqli->query($sql); }