Skip to content
Snippets Groups Projects
Commit e0c0b982 authored by Tizian Schmidlin's avatar Tizian Schmidlin Committed by Christian Kuhn
Browse files

[BUGFIX] Ensure uniqid calls use more_entropy

Precision of `uniqid()` on Windows systems without passing
`$more_entropy=true` has only single-second-resolution which will
lead to non-unique ids on subsequent calls.

In order to mitigate this issue TYPO3 provides the function
`StringUtility::getUniqueId($prefix = '')` which calls
`uniqid()` with parameter `$more_entropy` always set to true.

Using `uniqid()`, especially with `$more_entropy` set to true,
is quite slow, but for the purposes TYPO3 is using it
(i.e. creating unique field names for backend forms, path
identifiers in some modules etc.) it is good enough and
another solution would not provide any measurable benefit.

Resolves: #91553
Releases: master, 10.4
Change-Id: Ib4443e72621eee6df2daf5bf23054e1a01325783
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64652


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarJörg Bösche <typo3@joergboesche.de>
Tested-by: default avatarAlexander Schnitzler <git@alexanderschnitzler.de>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarJörg Bösche <typo3@joergboesche.de>
Reviewed-by: default avatarAlexander Schnitzler <git@alexanderschnitzler.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent d2d11699
Branches
Tags
No related merge requests found
Showing
with 38 additions and 22 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment