Actions
Bug #59701
closeduniqid() not returning unique values
Start date:
2014-06-20
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
uniqid() generates values based on current time,
subsequent calls may return the same value on a fast machine.
On Windows it's even worse, as uniqid()
has single-second-resolution out of the box.
Right now it is used in many places in the core, also for creating temporary identifiers for newly created records (in the datahanlder)
The solution is to add a second parameter to all calls (which adds more entropy).
see http://php.net/manual/en/function.uniqid.php
uniqid("prefix") => uniqid("prefix", TRUE)
With an empty prefix, the returned string will be 13 characters long. If more_entropy is TRUE, it will be 23 characters. So we need to test whether having longer id doesn;t break anything.
Actions