aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-03-24 15:06:13 +0100
committerJoas Schilling <nickvergessen@gmx.de>2012-08-21 11:59:35 +0200
commitf5063a6eda49d2a35b2aed486f86cde76e0f04a8 (patch)
tree801d61aea25c5a86ba0112a70899834c25a14140 /phpBB/includes/functions_admin.php
parent91384d8395166ec21995103410e35f7ba28ac830 (diff)
downloadforums-f5063a6eda49d2a35b2aed486f86cde76e0f04a8.tar
forums-f5063a6eda49d2a35b2aed486f86cde76e0f04a8.tar.gz
forums-f5063a6eda49d2a35b2aed486f86cde76e0f04a8.tar.bz2
forums-f5063a6eda49d2a35b2aed486f86cde76e0f04a8.tar.xz
forums-f5063a6eda49d2a35b2aed486f86cde76e0f04a8.zip
[ticket/10714] Add incorrect offset calculation in view_log function
PHPBB3-10714
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index e05ed3cdde..fd1f5568ab 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -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