Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #10017: Make sure rand is only evaluated once each survey…
…, using a cache for the function result
- Loading branch information
1 parent
b9260c8
commit a2dc8ab
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work when you have more than one rand() in a single expression? Is the hash still unique?
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, check if cache is cleared when newtest=Y
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
killSurveySession kill all rand value for ALL surveys (and all questions)
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$SESSION['survey'.$iSurveyID]['randResultCache']
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sha1 instead of md5
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serialize instead of flatten
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12:45:30 - shnoulle: Did you do a quick test : join(rand(1,10),rand(1,10),rand(1,10)) ?
12:45:51 - shnoulle: It's not the same ? alwayss 111 or 777 or 888 ?
a2dc8ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem with serialize: https://davidwalsh.name/php-serialize-unserialize-issues