2017-01-02, 05:01 PM
The following code in ./newreply.php can cause the moderator options (close/stick thread) to disappear:
The loop resets $fid, which then means subsequent calls to is_moderator() check a different forum, and unless the user is also a moderator of that forum, the moderation options will then be hidden. This then means that threads that are closed/stuck will be opened/unstuck as the field is not in the form.
To reproduce: have 2 forums, set a user to be a moderator of the one with the smaller ID. Try to then quote any post, and you will not see the close/stick thread options.
The solution is to just not use $fid as the key in the loop.
foreach($group_permissions as $fid => $forum_permissions)
{
if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}
The loop resets $fid, which then means subsequent calls to is_moderator() check a different forum, and unless the user is also a moderator of that forum, the moderation options will then be hidden. This then means that threads that are closed/stuck will be opened/unstuck as the field is not in the form.
To reproduce: have 2 forums, set a user to be a moderator of the one with the smaller ID. Try to then quote any post, and you will not see the close/stick thread options.
The solution is to just not use $fid as the key in the loop.