mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 10:06:52 +02:00
only allow valid types for doExport
backport of
This commit is contained in:
@@ -64,6 +64,10 @@ module.exports = function (SocketUser) {
|
||||
};
|
||||
|
||||
async function doExport(socket, data, type) {
|
||||
const validTypes = ['profile', 'posts', 'uploads'];
|
||||
if (!validTypes.includes(type)) {
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
if (!socket.uid) {
|
||||
throw new Error('[[error:invalid-uid]]');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user