Skip to content

Commit

Permalink
revert #273; it breaks multisite keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss committed Sep 28, 2020
1 parent f1d3e14 commit fbfc86f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1779,18 +1779,10 @@ function ( $keys ) {
* @return string
*/
public function build_key( $key, $group = 'default' ) {
static $keys = [];

if ( empty( $group ) ) {
$group = 'default';
}

$key_index = "{$key}:{$group}";

if ( isset( $keys[ $key_index ] ) ) {
return $keys[ $key_index ];
}

$salt = defined( 'WP_REDIS_PREFIX' ) ? trim( WP_REDIS_PREFIX ) : '';
$prefix = $this->is_global_group( $group ) ? $this->global_prefix : $this->blog_prefix;

Expand All @@ -1799,7 +1791,7 @@ public function build_key( $key, $group = 'default' ) {

$prefix = trim( $prefix, '_-:$' );

return $keys[ $key_index ] = "{$salt}{$prefix}:{$group}:{$key}";
return "{$salt}{$prefix}:{$group}:{$key}";
}

/**
Expand Down

0 comments on commit fbfc86f

Please sign in to comment.