Fixed ordering for timestamp verification

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-12-16 10:38:04 +01:00
parent ede81c7f11
commit 376d095c54

View File

@ -353,7 +353,7 @@ class ModelSearchMessage extends Model {
* If the hashes are the same, then verify by the public key as well
*/
$query = $this->db->query("SELECT `start_id`, `stop_id`, `hash_value`, `response_time`, `response_string` FROM " . TABLE_TIMESTAMP . " WHERE start_id <= ? AND stop_id >= ? ORDER BY id", array($id, $id));
$query = $this->db->query("SELECT `start_id`, `stop_id`, `hash_value`, `response_time`, `response_string` FROM " . TABLE_TIMESTAMP . " WHERE start_id <= ? AND stop_id >= ?", array($id, $id));
if(isset($query->row['start_id']) && isset($query->row['stop_id'])) {
@ -365,7 +365,7 @@ class ModelSearchMessage extends Model {
if($computed_hash == '') {
$query2 = $this->db->query("SELECT digest FROM " . TABLE_META . " WHERE id >= ? AND id <= ?", array($query->row['start_id'], $query->row['stop_id']));
$query2 = $this->db->query("SELECT digest FROM " . TABLE_META . " WHERE id >= ? AND id <= ? ORDER BY id", array($query->row['start_id'], $query->row['stop_id']));
foreach($query2->rows as $q) {
$s .= $q['digest'];