mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
ImportEtherpad: Reject unknown DB records
This commit is contained in:
parent
8e9bc8d325
commit
00fc7c8e86
2 changed files with 16 additions and 5 deletions
|
@ -53,17 +53,18 @@ exports.setPadRaw = async (padId, r) => {
|
|||
return;
|
||||
}
|
||||
value.padIDs = {[padId]: 1};
|
||||
} else {
|
||||
} else if (padKeyPrefixes.includes(prefix)) {
|
||||
if (prefix === 'pad' && keyParts.length === 2 && value.pool) {
|
||||
for (const attrib of Object.keys(value.pool.numToAttrib)) {
|
||||
const attribName = value.pool.numToAttrib[attrib][0];
|
||||
if (!supportedElems.has(attribName)) unsupportedElements.add(attribName);
|
||||
}
|
||||
}
|
||||
if (padKeyPrefixes.includes(prefix)) {
|
||||
keyParts[1] = padId;
|
||||
key = keyParts.join(':');
|
||||
}
|
||||
keyParts[1] = padId;
|
||||
key = keyParts.join(':');
|
||||
} else {
|
||||
logger.warn(`(pad ${padId}) Ignoring record with unsupported key: ${key}`);
|
||||
return;
|
||||
}
|
||||
await db.set(key, value);
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue