Fixed error when trying to view a non-existent topic when logged out.
This commit is contained in:
parent
17e0d1f591
commit
edc64b45ff
1 changed files with 11 additions and 9 deletions
|
@ -65,19 +65,21 @@ if(!$topicIsNuked) {
|
||||||
$canDeleteAny = $perms->check(Perm::F_POST_DELETE_ANY);
|
$canDeleteAny = $perms->check(Perm::F_POST_DELETE_ANY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($topicIsNuked || $topicIsDeleted) && $forumTopicRedirects->hasTopicRedirect($topicId)) {
|
if($topicIsNuked || $topicIsDeleted) {
|
||||||
|
if($forumTopicRedirects->hasTopicRedirect($topicId)) {
|
||||||
$topicRedirectInfo = $forumTopicRedirects->getTopicRedirect($topicId);
|
$topicRedirectInfo = $forumTopicRedirects->getTopicRedirect($topicId);
|
||||||
Template::set('topic_redir_info', $topicRedirectInfo);
|
Template::set('topic_redir_info', $topicRedirectInfo);
|
||||||
|
|
||||||
if($topicIsNuked || !$canDeleteAny) {
|
if($topicIsNuked || !$canDeleteAny) {
|
||||||
if(empty($topicRedirectInfo))
|
|
||||||
Template::throwError(404);
|
|
||||||
|
|
||||||
header('Location: ' . $topicRedirectInfo->getLinkTarget());
|
header('Location: ' . $topicRedirectInfo->getLinkTarget());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($topicRedirectInfo))
|
||||||
|
Template::throwError(404);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$perms->check(Perm::F_CATEGORY_VIEW))
|
if(!$perms->check(Perm::F_CATEGORY_VIEW))
|
||||||
Template::throwError(403);
|
Template::throwError(403);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue