diff --git a/object-cache.php b/object-cache.php index dd2ff80..c94535f 100644 --- a/object-cache.php +++ b/object-cache.php @@ -727,7 +727,13 @@ function key( $key, $group ) { $prefix .= $this->blog_prefix; } - return preg_replace( '/\s+/', '', "$prefix:$group:$key" ); + $trimmed = preg_replace( '/\s+/', '', "$prefix:$group:$key" ); + if ( strlen( $trimmed ) <= 250 ) { + return $trimmed; + } + + $trimmed = substr( $trimmed, 0, 200 ) . ':redacted:' . md5( $trimmed ); + return $trimmed; } function replace( $id, $data, $group = 'default', $expire = 0 ) {