diff options
author | arun <arun@nubati.net> | 2007-04-25 08:17:43 +0000 |
---|---|---|
committer | arun <arun> | 2007-04-25 08:17:43 +0000 |
commit | f76fa7b25a6b09c2443680e1ae915cd949704d4e (patch) | |
tree | 3972825ddf85258ddf6a01f6b91e9e838477ae1b /index.php | |
parent | 3f0e64bb007762df358925569e980a7718ff033d (diff) | |
download | e-DoKo-f76fa7b25a6b09c2443680e1ae915cd949704d4e.tar.gz e-DoKo-f76fa7b25a6b09c2443680e1ae915cd949704d4e.tar.bz2 e-DoKo-f76fa7b25a6b09c2443680e1ae915cd949704d4e.zip |
fix: hash collision after a game has been cancled and the gameid is being reused.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -109,10 +109,11 @@ if(myisset("new")) $game_id = mysql_insert_id(); /* create hash */ - $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA); - $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB); - $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC); - $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD); + $TIME = (string) time(); /* to avoid collisions */ + $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA.$TIME); + $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB.$TIME); + $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC.$TIME); + $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD.$TIME); /* create hands */ mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridA). |