X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=server%2Fmodels%2FGame.js;h=401e36533c78565f3457884791666dac08ee07a7;hb=e78633dbd29be1920e0c02509b6ce62b87b61d77;hp=ee381d4227329100712470bcb46f2b5fab3a934f;hpb=1ef65040168ab7d55ce921abc9d63644a937d689;p=vchess.git diff --git a/server/models/Game.js b/server/models/Game.js index ee381d42..401e3653 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -309,11 +309,12 @@ const GameModel = ) && ( !obj.rematchOffer || !!(obj.rematchOffer.match(/^[wbn]$/)) ) && ( - !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9, /-]*$/)) + // TODO: check if commas are still used (probably not) + !obj.fen || !!(obj.fen.match(/^[a-zA-Z0-9,. /-]*$/)) ) && ( !obj.score || !!(obj.score.match(/^[012?*\/-]+$/)) ) && ( - !obj.chatRead || !(['w','b'].includes(obj.chatRead)) + !obj.chatRead || ['w','b'].includes(obj.chatRead) ) && ( !obj.scoreMsg || !!(obj.scoreMsg.match(/^[a-zA-Z ]+$/)) ) && ( @@ -483,6 +484,7 @@ const GameModel = ) || ( + !!movesGroups[g.id] && movesGroups[g.id].nbMoves == 1 && tsNow - movesGroups[g.id].lastMaj > 14*day )