diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 086ec6e1..b9956eb7 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -883,7 +883,11 @@ function mod_page_ip($ip, string $encoded_cursor = '') { Bans::delete($_POST['ban_id'], true, $mod['boards']); - header('Location: ?/IP/' . $ip . '#bans', true, $config['redirect_http']); + if (empty($encoded_cursor)) { + header("Location: ?/IP/$ip#bans", true, $config['redirect_http']); + } else { + header("Location: ?/IP/$ip/cursor/$encoded_cursor#bans", true, $config['redirect_http']); + } return; } @@ -904,7 +908,11 @@ function mod_page_ip($ip, string $encoded_cursor = '') { modLog("Added a note for {$ip}"); - header('Location: ?/IP/' . $ip . '#notes', true, $config['redirect_http']); + if (empty($encoded_cursor)) { + header("Location: ?/IP/$ip#notes", true, $config['redirect_http']); + } else { + header("Location: ?/IP/$ip/cursor/$encoded_cursor#notes", true, $config['redirect_http']); + } return; } @@ -1043,7 +1051,11 @@ function mod_page_ip($ip, string $encoded_cursor = '') { $args['logs'] = []; } - $args['security_token'] = make_secure_link_token('IP/' . $ip); + if (empty($encoded_cursor)) { + $args['security_token'] = make_secure_link_token("IP/$ip"); + } else { + $args['security_token'] = make_secure_link_token("IP/$ip/cursor/$encoded_cursor"); + } mod_page(sprintf('%s: %s', _('IP'), htmlspecialchars($ip)), 'mod/view_ip.html', $args, $args['hostname']); }