pages.php: change security token of mod_user_posts_by_ip

This commit is contained in:
Zankaria 2024-12-29 00:01:09 +01:00
parent 4b49019282
commit e87f50407c

View file

@ -1052,10 +1052,11 @@ function mod_user_posts_by_ip(Context $ctx, string $ip, string $encoded_cursor =
$args['boards'] = $boards;
$args['token'] = make_secure_link_token('ban');
// Since the security token is only used to send requests to create notes and remove bans, use "?/IP/" as the url.
if (empty($encoded_cursor)) {
$args['security_token'] = make_secure_link_token("user_posts/ip/$ip");
$args['security_token'] = make_secure_link_token("IP/$ip");
} else {
$args['security_token'] = make_secure_link_token("user_posts/ip/$ip/cursor/$encoded_cursor");
$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']);