Skip to content
Permalink
Browse files

Undefined index: traveler in /lib/tmphpfuncs.php on line 382

  • Loading branch information...
yakra committed Jul 11, 2019
1 parent 4dfc9bd commit 8f785025861fda7a7190d770b0485817a89e2782
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/tmphpfuncs.php
@@ -375,10 +375,10 @@ function tm_update_time() {
// associative array) as the value associated with a new key 'rank'.
function tm_fetch_user_row_with_rank($res, $rankBy) {
global $tmuser;
$nextRank = 1;
$nextRank = 2;
$rank = 1;
$score = 0;
$row = array();
$row = $res->fetch_assoc();
while($row['traveler'] != $tmuser && $row = $res->fetch_assoc()) {
if ($score != $row[$rankBy]) {
$score = $row[$rankBy];

1 comment on commit 8f78502

@yakra

This comment has been minimized.

Copy link
Contributor Author

commented on 8f78502 Jul 18, 2019

Nope. Introduced a bug.
Our results are already ordered by $rankBy, so this only affects first-place ties.
A traveler tied for 1st who's not the first ordered result from our query gets their rank prematurely increased to 2, because $score is still 0, and not yet equal to $row[$rankBy]. Will fix with #328.

Please sign in to comment.
You can’t perform that action at this time.