mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
closes #2477
This commit is contained in:
@@ -8,6 +8,7 @@ var async = require('async'),
|
||||
topics = require('../topics'),
|
||||
categories = require('../categories'),
|
||||
meta = require('../meta'),
|
||||
helpers = require('../controllers/helpers'),
|
||||
privileges = require('../privileges');
|
||||
|
||||
function hasTopicPrivileges(req, res, next) {
|
||||
@@ -31,7 +32,7 @@ function hasPrivileges(method, id, req, res, next) {
|
||||
}
|
||||
|
||||
if (!canRead) {
|
||||
return res.redirect(nconf.get('relative_path') + '/403');
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
return next();
|
||||
@@ -53,7 +54,7 @@ function generateForTopic(req, res, next) {
|
||||
}
|
||||
|
||||
if (topicData.deleted && !userPrivileges.view_deleted) {
|
||||
return res.redirect(nconf.get('relative_path') + '/404');
|
||||
return helpers.notFound(req, res);
|
||||
}
|
||||
|
||||
var description = topicData.posts.length ? topicData.posts[0].content : '';
|
||||
@@ -137,8 +138,8 @@ function generateForPopular(req, res, next) {
|
||||
}
|
||||
|
||||
function disabledRSS(req, res, next) {
|
||||
if (meta.config['feeds:disableRSS'] === '1') {
|
||||
return res.redirect(nconf.get('relative_path') + '/404');
|
||||
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
|
||||
return helpers.notFound(req, res);
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user