Second fix for mesh link escaping.

This commit is contained in:
Ylian Saint-Hilaire 2020-12-30 22:18:29 -08:00
parent e879e44713
commit 333c7c7876
2 changed files with 86 additions and 89 deletions

5
db.js
View File

@ -108,6 +108,7 @@ module.exports.CreateDB = function (parent, func) {
// Add this as a valid user identifier
validIdentifiers[docs[i]._id] = 1;
}
}
// Fix all of the creating & login to ticks by seconds, not milliseconds.
obj.GetAllType('user', function (err, docs) {
@ -171,7 +172,7 @@ module.exports.CreateDB = function (parent, func) {
var xid = j, xid2 = common.unEscapeFieldName(xid);
while ((xid != xid2) && (validIdentifiers[xid2] == null)) { xid = xid2; xid2 = common.unEscapeFieldName(xid2); }
if (validIdentifiers[xid2] == 1) {
//console.log('Fixing id: ' + j + ' to ' + common.escapeFieldName(xid2));
//console.log('Fixing id: ' + j + ' to ' + xid2);
docs[i].links[xid2] = docs[i].links[j];
delete docs[i].links[j];
meshChange = true;
@ -204,9 +205,7 @@ module.exports.CreateDB = function (parent, func) {
});
}
});
}
});
};
// Get encryption key

View File

@ -2765,8 +2765,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
case 'createmesh':
{
console.log(command);
var err = null;
try {
// Check if we have new group restriction