mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
More code clean up and input validation.
This commit is contained in:
parent
bee668d502
commit
984ce8b201
4 changed files with 9 additions and 9 deletions
|
@ -516,7 +516,7 @@ module.exports.pluginHandler = function (parent) {
|
|||
};
|
||||
|
||||
obj.handleAdminReq = function (req, res, user, serv) {
|
||||
if (obj.common.isAlphaNumeric(req.query.pin) !== true) { res.sendStatus(401); return; }
|
||||
if ((req.query.pin == null) || (obj.common.isAlphaNumeric(req.query.pin) !== true)) { res.sendStatus(401); return; }
|
||||
var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
|
||||
if (obj.common.IsFilenameValid(path) !== true) { res.sendStatus(401); return; }
|
||||
serv.app.set('views', path);
|
||||
|
@ -528,7 +528,7 @@ module.exports.pluginHandler = function (parent) {
|
|||
}
|
||||
|
||||
obj.handleAdminPostReq = function (req, res, user, serv) {
|
||||
if (obj.common.isAlphaNumeric(req.query.pin) !== true) { res.sendStatus(401); return; }
|
||||
if ((req.query.pin == null) || (obj.common.isAlphaNumeric(req.query.pin) !== true)) { res.sendStatus(401); return; }
|
||||
var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
|
||||
if (obj.common.IsFilenameValid(path) !== true) { res.sendStatus(401); return; }
|
||||
serv.app.set('views', path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue