mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
Fix agent metadata (agentFileInfo), the ProductVersion and FileVersion.
This commit is contained in:
13
common.js
13
common.js
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user