mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
dont escape the query that is send to search escape on the way out
This commit is contained in:
@@ -17,7 +17,6 @@ searchController.search = function(req, res, next) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
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)) {
|
||||||
req.query.categories = [req.query.categories];
|
req.query.categories = [req.query.categories];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
|
validator = require('validator'),
|
||||||
|
|
||||||
db = require('./database'),
|
db = require('./database'),
|
||||||
posts = require('./posts'),
|
posts = require('./posts'),
|
||||||
@@ -21,7 +22,7 @@ search.search = function(data, callback) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.search_query = query;
|
result.search_query = validator.escape(query);
|
||||||
if (searchIn === 'titles' || searchIn === 'titlesposts') {
|
if (searchIn === 'titles' || searchIn === 'titlesposts') {
|
||||||
searchIn = 'posts';
|
searchIn = 'posts';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user