Skip to content

Commit

Permalink
perf: optimize media item cache key generation
Browse files Browse the repository at this point in the history
closes #974 (`wp_rand()` WP 6.1 bug on 32-bit platforms)
  • Loading branch information
Archetyped committed Nov 18, 2022
1 parent 7b864ac commit ea4d5e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ private function cache_media_item( $uri, $type, $internal, $props = null ) {
if ( null === $key ) {
// Generate Unique ID.
do {
$key = (string) wp_rand();
$key = mt_rand();
} while ( isset( $this->media_items_raw['props'][ $key ] ) );
// Build properties object.
$i = $this->media_item_template;
Expand Down

0 comments on commit ea4d5e9

Please sign in to comment.