Removed all instances of srand. This is called implicitily by rand and be dangerous if called mulitple times by the same process.

This commit is contained in:
Kaleb Murphy 2008-11-10 21:53:30 +00:00
parent 3af1b41542
commit 70a0a422b7
6 changed files with 2 additions and 7 deletions

View file

@ -13,7 +13,7 @@
- added: Delete columns from DataTable
- fixed: Now more than one DataTable can be put on a page
- fixed #9002: add a variant in admin product view misses i18n link
- fixed #9034: Removed all instances of srand. This is called implicitily by rand and be dangerous if called mulitple times by the same process.
7.6.2
- fixed: not allowed to add calendar events if in can edit group but not can add event group
- sped up lineage changes significantly

View file

@ -34,7 +34,7 @@ sub createSurveyOrder{
my $self = shift;
my $order;
my $qstarting = 0;
$self->log('wtf am I faling for');
for(my $s = 0; $s <= $#{$self->survey->sections()}; $s++){
#create question order for section
my @qorder;

View file

@ -41,7 +41,6 @@ sub process {
if (defined $asset) {
my $children = $asset->getLineage(["children"]);
#randomize;
srand;
my $randomAssetId = $children->[rand(scalar(@{$children}))];
my $randomAsset = WebGUI::Asset->newByDynamicClass($session,$randomAssetId);
if (defined $randomAsset) {

View file

@ -60,8 +60,6 @@ URL of the template to use to display the random thread. Must be a valid URL wit
sub process {
my $session = shift;
my ($startURL, $relatives, $templateURL) = @_;
# Seed the randomizer:
srand;
# Set defaults (default template is set by id later):
$startURL ||= 'home';

View file

@ -101,7 +101,6 @@ A reference to the current session.
sub new {
my $class = shift;
my $session = shift;
srand;
bless {_session=>$session}, $class;
}

View file

@ -73,7 +73,6 @@ sub addFileFromCaptcha {
my $self = shift;
my $error = "";
my $challenge;
srand;
$challenge.= ('A'..'Z')[rand(26)] foreach (1..6);
my $filename = "captcha.".$self->session->id->generate().".gif";
my $image = $graphicsPackage->new();