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:
parent
f735693d75
commit
b760bb6116
5 changed files with 95 additions and 16 deletions
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue