mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Don't change url when homepage is set to a category.
This commit is contained in:
@@ -50,7 +50,16 @@ Controllers.home = function(req, res, next) {
|
|||||||
} else if (route === 'popular') {
|
} else if (route === 'popular') {
|
||||||
Controllers.popular.get(req, res, next);
|
Controllers.popular.get(req, res, next);
|
||||||
} else {
|
} else {
|
||||||
res.redirect(route);
|
var match = /^category\/(\d+)\/(.*)$/.exec(route);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
req.params.topic_index = "1";
|
||||||
|
req.params.category_id = match[1];
|
||||||
|
req.params.slug = match[2];
|
||||||
|
Controllers.categories.get(req, res, next);
|
||||||
|
} else {
|
||||||
|
res.redirect(route);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user