Skip to content

Commit b771f34

Browse files
committed
Only use str_replace if key contains a space
1 parent 1d2a117 commit b771f34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/drop-in/object-cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private function cache_key(
157157

158158
// Unfortunately WordPress uses a lot of keys with spaces,
159159
// and the memcached text protocol doesn't allow that.
160-
if ( ! SNAPCACHE_MEMCACHED_USE_BINARY ) {
160+
if ( ! SNAPCACHE_MEMCACHED_USE_BINARY && str_contains( $key, ' ' ) ) {
161161
$key = str_replace( ' ', '_', $key );
162162
}
163163

0 commit comments

Comments
 (0)