mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
sanitizeQuery fix, minor chat crash fix
This commit is contained in:
parent
0a40e1024b
commit
6335069b60
3 changed files with 9 additions and 3 deletions
|
@ -113,6 +113,9 @@ function setup(data: SubmoduleData): void {
|
|||
|
||||
socket.on('chat message', (message) => {
|
||||
const { reciever, msg, type } = message
|
||||
if (!reciever || !msg || !type) {
|
||||
return
|
||||
}
|
||||
const recieverUser = dbtools.Select(userDB, 'users', {
|
||||
id: reciever,
|
||||
})[0]
|
||||
|
|
|
@ -22,8 +22,11 @@ import utils from '../utils/utils'
|
|||
|
||||
const debugLog = process.env.NS_SQL_DEBUG_LOG
|
||||
|
||||
function sanitizeQuery(val: string): string {
|
||||
return val.replace(/'/g, '').replace(/;/g, '')
|
||||
function sanitizeQuery(val) {
|
||||
if (typeof val === 'string') {
|
||||
return val.replace(/'/g, '').replace(/;/g, '')
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// { asd: 'asd', basd: 4 } => asd = 'asd', basd = 4
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1012880e899ad328f7a637a6d1512dab7afd24d5
|
||||
Subproject commit 4f82b9d8c9c32ebbd9d73b951fc1db26ad1ceb22
|
Loading…
Add table
Add a link
Reference in a new issue