projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update TODO
[vchess.git]
/
server
/
models
/
Game.js
diff --git
a/server/models/Game.js
b/server/models/Game.js
index
d72f51a
..
3945917
100644
(file)
--- a/
server/models/Game.js
+++ b/
server/models/Game.js
@@
-197,17
+197,17
@@
const GameModel =
return (
(
!obj.move || (
return (
(
!obj.move || (
-
obj.move.played.toString().match(/^[0-9]+$/
) &&
-
obj.move.idx.toString().match(/^[0-9]+$/
)
+
!!(obj.move.played.toString().match(/^[0-9]+$/)
) &&
+
!!(obj.move.idx.toString().match(/^[0-9]+$/)
)
)
) && (
)
) && (
- !obj.drawOffer ||
obj.drawOffer.match(/^[wbtn]$/
)
+ !obj.drawOffer ||
!!(obj.drawOffer.match(/^[wbtn]$/)
)
) && (
) && (
- !obj.fen ||
obj.fen.match(/^[a-zA-Z0-9, /-]*$/
)
+ !obj.fen ||
!!(obj.fen.match(/^[a-zA-Z0-9, /-]*$/)
)
) && (
) && (
- !obj.score ||
obj.score.match(/^[012?*\/-]+$/
)
+ !obj.score ||
!!(obj.score.match(/^[012?*\/-]+$/)
)
) && (
) && (
- !obj.scoreMsg ||
obj.scoreMsg.match(/^[a-zA-Z ]+$/
)
+ !obj.scoreMsg ||
!!(obj.scoreMsg.match(/^[a-zA-Z ]+$/)
)
) && (
!obj.chat || UserModel.checkNameEmail({name: obj.chat.name})
)
) && (
!obj.chat || UserModel.checkNameEmail({name: obj.chat.name})
)
@@
-243,7
+243,7
@@
const GameModel =
db.run(query);
}
// NOTE: move, chat and delchat are mutually exclusive
db.run(query);
}
// NOTE: move, chat and delchat are mutually exclusive
- if (obj.move)
+ if (
!!
obj.move)
{
// Security: only update moves if index is right
query =
{
// Security: only update moves if index is right
query =