Skip to content

Instantly share code, notes, and snippets.

@nickvergessen
Created March 24, 2012 14:16
Show Gist options
  • Save nickvergessen/2183362 to your computer and use it in GitHub Desktop.
Save nickvergessen/2183362 to your computer and use it in GitHub Desktop.
phpBB/includes/functions_admin.php | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 45538fa..abf0d2c 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2583,9 +2583,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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment