mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	fix: redir on bad world filter
This commit is contained in:
		| @@ -9,7 +9,7 @@ const helpers = require('../helpers'); | |||||||
|  |  | ||||||
| const controller = module.exports; | const controller = module.exports; | ||||||
|  |  | ||||||
| controller.list = async function (req, res) { | controller.list = async function (req, res, next) { | ||||||
| 	const { topicsPerPage } = await user.getSettings(req.uid); | 	const { topicsPerPage } = await user.getSettings(req.uid); | ||||||
| 	const page = parseInt(req.query.page, 10) || 1; | 	const page = parseInt(req.query.page, 10) || 1; | ||||||
| 	const start = Math.max(0, (page - 1) * topicsPerPage); | 	const start = Math.max(0, (page - 1) * topicsPerPage); | ||||||
| @@ -18,6 +18,8 @@ controller.list = async function (req, res) { | |||||||
| 	const sets = ['cid:-1:tids', `uid:${req.uid}:inbox`]; | 	const sets = ['cid:-1:tids', `uid:${req.uid}:inbox`]; | ||||||
| 	if (req.params.filter === 'all' || !req.uid) { | 	if (req.params.filter === 'all' || !req.uid) { | ||||||
| 		sets.pop(); | 		sets.pop(); | ||||||
|  | 	} else if (req.params.filter) { | ||||||
|  | 		return helpers.redirect(res, '/world', false); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	const tids = await db.getSortedSetRevIntersect({ | 	const tids = await db.getSortedSetRevIntersect({ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user