Fixed plugin path check.

Ylian Saint-Hilaire committed Jul 9, 2020 at 15:48 UTC f412af4de0c60179479fb17f38e504dd3d5fdffc
1 file changed -4
pluginHandler.js
-4
@@ -518,8 +518,6 @@ module.exports.pluginHandler = function (parent) {
518 obj.handleAdminReq = function (req, res, user, serv) {
519 if ((req.query.pin == null) || (obj.common.isAlphaNumeric(req.query.pin) !== true)) { res.sendStatus(401); return; }
520 var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
521 - // path isn't a filename, it is a folder path
522 - //if (obj.common.IsFilenameValid(path) !== true) { res.sendStatus(401); return; }
521 serv.app.set('views', path);
522 if ((obj.plugins[req.query.pin] != null) && (typeof obj.plugins[req.query.pin].handleAdminReq == 'function')) {
523 obj.plugins[req.query.pin].handleAdminReq(req, res, user);
@@ -531,8 +529,6 @@ module.exports.pluginHandler = function (parent) {
529 obj.handleAdminPostReq = function (req, res, user, serv) {
530 if ((req.query.pin == null) || (obj.common.isAlphaNumeric(req.query.pin) !== true)) { res.sendStatus(401); return; }
531 var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
534 - // path isn't a filename, it is a folder path
535 - //if (obj.common.IsFilenameValid(path) !== true) { res.sendStatus(401); return; }
532 serv.app.set('views', path);
533 if ((obj.plugins[req.query.pin] != null) && (typeof obj.plugins[req.query.pin].handleAdminPostReq == 'function')) {
534 obj.plugins[req.query.pin].handleAdminPostReq(req, res, user);