1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 23:55:26 +02:00

[ticket/10714] Add incorrect offset calculation in view_log function

PHPBB3-10714
This commit is contained in:
Joas Schilling 2012-03-24 15:06:13 +01:00
parent 91384d8395
commit f5063a6eda

View File

@ -2584,9 +2584,13 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
return 0;
}
if ($offset >= $log_count)
if ($log_count)
{
$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
// Return the user to the last page that is valid
while ($offset >= $log_count)
{
$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
}
}
$sql = "SELECT l.*, u.username, u.username_clean, u.user_colour