mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
closes #2822
This commit is contained in:
@@ -23,26 +23,6 @@ searchController.search = function(req, res, next) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!req.params.term) {
|
|
||||||
var results = {
|
|
||||||
time: 0,
|
|
||||||
search_query: '',
|
|
||||||
posts: [],
|
|
||||||
users: [],
|
|
||||||
tags: [],
|
|
||||||
categories: categories,
|
|
||||||
breadcrumbs: breadcrumbs,
|
|
||||||
expandSearch: true
|
|
||||||
};
|
|
||||||
plugins.fireHook('filter:search.build', {data: {}, results: results}, function(err, data) {
|
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
res.render('search', data.results);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
req.params.term = validator.escape(req.params.term);
|
req.params.term = validator.escape(req.params.term);
|
||||||
var page = Math.max(1, parseInt(req.query.page, 10)) || 1;
|
var page = Math.max(1, parseInt(req.query.page, 10)) || 1;
|
||||||
if (req.query.categories && !Array.isArray(req.query.categories)) {
|
if (req.query.categories && !Array.isArray(req.query.categories)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user