Skip to content

Commit

Permalink
Secure uniqid usage
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Dec 6, 2016
1 parent a617045 commit d00b7e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Phpml/SupportVectorMachine/SupportVectorMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function train(array $samples, array $labels)
{
$this->labels = $labels;
$trainingSet = DataTransformer::trainingSet($samples, $labels, in_array($this->type, [Type::EPSILON_SVR, Type::NU_SVR]));
file_put_contents($trainingSetFileName = $this->varPath.uniqid(), $trainingSet);
file_put_contents($trainingSetFileName = $this->varPath.uniqid('phpml', true), $trainingSet);
$modelFileName = $trainingSetFileName.'-model';

$command = $this->buildTrainCommand($trainingSetFileName, $modelFileName);
Expand Down Expand Up @@ -161,7 +161,7 @@ public function getModel()
public function predict(array $samples)
{
$testSet = DataTransformer::testSet($samples);
file_put_contents($testSetFileName = $this->varPath.uniqid(), $testSet);
file_put_contents($testSetFileName = $this->varPath.uniqid('phpml', true), $testSet);
file_put_contents($modelFileName = $testSetFileName.'-model', $this->model);
$outputFileName = $testSetFileName.'-output';

Expand Down

0 comments on commit d00b7e5

Please sign in to comment.