Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/db/dbmigrate_2.1-2.2.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Migrate_21_22($Verbose)
{
// No Default User, so create one
$Perm = 10; //PLUGIN_DB_ADMIN;
$Seed = rand() . rand();
$Seed = random_int(0, getrandmax()) . random_int(0, getrandmax());
$Hash = sha1($Seed . $user_name);
$sql = "INSERT INTO users (user_name,user_desc,user_seed,user_pass,user_perm,user_email,root_folder_fk)
VALUES ('$user_name','Default Administrator','$Seed','$Hash',$Perm,'y',1);";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/php/common-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function ReportCacheGet($CacheKey)
global $UserCacheStat;

/* Purge old entries ~ 1/500 of the times this fcn is called */
if (rand(1, 500) == 1) {
if (random_int(1, 500) == 1) {
ReportCachePurgeByDate(" now() - interval '365 days'");
}

Expand Down
2 changes: 1 addition & 1 deletion src/reportImport/ui/ReportImportAgentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function addReport($report)
mkdir($fileBase,0755,true);
}
// TODO: validate filename
$targetFile = time().'_'.rand().'_'.$report['name'];
$targetFile = time().'_'.random_int(0, getrandmax()).'_'.$report['name'];
if (move_uploaded_file($report['tmp_name'], $fileBase.$targetFile))
{
return '--report='.$targetFile;
Expand Down
2 changes: 1 addition & 1 deletion src/www/ui/core-smauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function Output()
$_SESSION['UserEmail'] = NULL;
$_SESSION['Folder'] = NULL;
$_SESSION['UiPref'] = NULL;
$Uri = Traceback_uri() . "logout.html?" . rand();
$Uri = Traceback_uri() . "logout.html?" . random_int(0, getrandmax());
//$Uri = Traceback_uri() . "?mod=refresh&remod=default";
$V.= "<script language='javascript'>\n";
$V.= "window.open('$Uri','_top');\n";
Expand Down
2 changes: 1 addition & 1 deletion src/www/ui_tests/foss_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function testFuncCreateFolder(){
$this->assertTrue($this->setField('parentid', 'Software Repository'));
// Generate a random number so names will not collide with multiple
// test runs.
$tail = rand();
$tail = random_int(0, getrandmax());
$folder_name = 'TestFolder' . "$tail";
$this->setField('newname', $folder_name);
$this->clickSubmit('Create!');
Expand Down