1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fix agent metadata (agentFileInfo), the ProductVersion and FileVersion.

This commit is contained in:
Ylian Saint-Hilaire 2022-08-04 01:47:36 -07:00
parent f735693d75
commit b760bb6116
5 changed files with 95 additions and 16 deletions

View file

@ -339,3 +339,16 @@ function validateObjectForMongoRec(obj, maxStrLen) {
}
return true;
}
// Parse a version string of the type n.n.n.n
module.exports.parseVersion = function (verstr) {
if (typeof verstr != 'string') return null;
const r = [], verstrsplit = verstr.split('.');
if (verstrsplit.length != 4) return null;
for (var i in verstrsplit) {
var n = parseInt(verstrsplit[i]);
if (isNaN(n) || (n < 0) || (n > 65535)) return null;
r.push(n);
}
return r;
}