Fixed forums with no posts throwing a 404.

This commit is contained in:
flash 2019-01-03 17:00:13 +01:00
parent 4f15544a30
commit 2086a6cde2
2 changed files with 2 additions and 2 deletions

View file

@ -37,7 +37,7 @@ if ($forum['forum_type'] == MSZ_FORUM_TYPE_LINK) {
$forumPagination = pagination_create($forum['forum_topic_count'], 20);
$topicsOffset = pagination_offset($forumPagination, pagination_param());
if (!pagination_is_valid_offset($topicsOffset)) {
if (!pagination_is_valid_offset($topicsOffset) && $forum['forum_topic_count'] > 0) {
echo render_error(404);
return;
}

View file

@ -4,7 +4,7 @@
{% set title = forum_info.forum_name %}
{% set canonical_url = url_construct('/forum/forum.php', {
'f': forum_info.forum_id,
'p': forum_pagination.page > 1 ? forum_pagination.page : 0,
'p': forum_pagination.page|default(0) > 1 ? forum_pagination.page : 0,
}) %}
{% block content %}