diff --git a/src/socket.io/user/profile.js b/src/socket.io/user/profile.js index 2dcbb1af03..d503a7f471 100644 --- a/src/socket.io/user/profile.js +++ b/src/socket.io/user/profile.js @@ -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]]'); }