Project

General

Profile

Actions

Bug #59701

closed

uniqid() not returning unique values

Added by Tymoteusz Motylewski almost 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
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.


Related issues 8 (0 open8 closed)

Related to TYPO3 Core - Bug #59529: Make Functional tests work on fast machines (especially on Windows)ClosedTymoteusz Motylewski2014-06-12

Actions
Related to TYPO3 Core - Bug #58602: Datepicker issue on multiple datetime fields in BEClosed2014-05-07

Actions
Related to TYPO3 Core - Bug #59055: Import from .t3d failed on Windows 7 with a lot of messagesClosedMarc Bastian Heinrichs

Actions
Related to TYPO3 Core - Bug #58768: Import from .t3d failed on Windows 7 with a lot of messages (6.1 => 6.2)Rejected2014-05-13

Actions
Related to TYPO3 Core - Bug #62438: Fix JS error after #30948ClosedMarkus Klein2014-10-24

Actions
Related to TYPO3 Core - Bug #63943: PHPUnit-Tests fail on WindowsClosedStephan Großberndt2014-12-16

Actions
Related to TYPO3 Core - Task #69050: Supply a Utility method to create unique ids in the coreClosedNicole Cordes2015-08-14

Actions
Related to TYPO3 Core - Bug #91553: Risk of non-unique field in DatePickerViewHelperClosed2020-06-02

Actions
Actions

Also available in: Atom PDF