Skip to content

Commit beecde8

Browse files
Tiago Ribeiroweaverryan
Tiago Ribeiro
authored andcommitted
Improve uniqid usage example
1 parent 1154f68 commit beecde8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/doctrine/file_uploads.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
266266
{
267267
if (null !== $this->file) {
268268
// do whatever you want to generate a unique name
269-
$this->path = uniqid().'.'.$this->file->guessExtension();
269+
$this->path = sha1(uniqid(mt_rand(), true)).'.'.$this->file->guessExtension();
270270
}
271271
}
272272

0 commit comments

Comments
 (0)