Use "more entropy" parameters on uniqid method

Created on 27 July 2022, over 2 years ago
Updated 7 February 2023, almost 2 years ago

The $more_entropy option of uniqid() should be used in facets_preprocess_facets_item_list : https://git.drupalcode.org/project/facets/-/blob/3.0.x/facets.module#L214
The uniqid() function takes a second argument called $more_entropy.
If $more_entropy is omitted or set to false:

  • on Cygwin, the function does not work;
  • on Windows, it yields non-unique values;
  • on other OSes, it calls usleep(1), pausing your entire application for 1 microsecond.

Therefore, the only way to make uniqid() generate reasonably unique values is to call it with true as second argument (uniqid('...', true)).

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇫🇷France Renrhaf 📍 Strasbourg 🐦🦜

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024