X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=server%2Fmodels%2FGame.js;h=401e36533c78565f3457884791666dac08ee07a7;hb=e78633dbd29be1920e0c02509b6ce62b87b61d77;hp=ed3fb436976cd2ac82be2de9b1cf82cd4176eda3;hpb=077ba3446c4ea3c6553c325fc8d16a96b7a9ff4f;p=vchess.git diff --git a/server/models/Game.js b/server/models/Game.js index ed3fb436..401e3653 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -309,7 +309,8 @@ 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?*\/-]+$/)) ) && ( @@ -483,6 +484,7 @@ const GameModel = ) || ( + !!movesGroups[g.id] && movesGroups[g.id].nbMoves == 1 && tsNow - movesGroups[g.id].lastMaj > 14*day )