WhatCD / Gazelle

http://whatcd.github.io/Gazelle/
1.84k stars 363 forks source link

Off-by-one in sections/userhistory/post_history.php #89

Open MrPMan opened 8 years ago

MrPMan commented 8 years ago

sections/userhistory/post_history.php: line 216 expects l.PostID for $LastRead, which is only selected if $UserID is $LoggedUser['ID'] and grouping is disabled

Line 216 of sections/userhistory/post_history.php expects l.PostID for $LastRead, but, as shown in lines 108-111, it is possible for l.PostID to not be selected from the database. A simple solution would be to select l.PostID last, so the undefined offset will simply result in $LastRead being null.