Skip to content

Commit 2900a52

Browse files
committed
Add check that redis_version is set
1 parent 00bd8a2 commit 2900a52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/object-cache.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ protected function lua_flush_closure( $salt, $escape = true ) {
18841884
return i
18851885
LUA;
18861886

1887-
if ( version_compare( $this->redis_version(), '5', '<' ) && version_compare( $this->redis_version(), '3.2', '>=' ) ) {
1887+
if ( isset($this->redis_version) && version_compare( $this->redis_version, '5', '<' ) && version_compare( $this->redis_version, '3.2', '>=' ) ) {
18881888
$script = 'redis.replicate_commands()' . "\n" . $script;
18891889
}
18901890

@@ -1936,7 +1936,7 @@ function ( $group ) {
19361936
until 0 == cur
19371937
return i
19381938
LUA;
1939-
if ( version_compare( $this->redis_version(), '5', '<' ) && version_compare( $this->redis_version(), '3.2', '>=' ) ) {
1939+
if ( isset($this->redis_version) && version_compare( $this->redis_version, '5', '<' ) && version_compare( $this->redis_version, '3.2', '>=' ) ) {
19401940
$script = 'redis.replicate_commands()' . "\n" . $script;
19411941
}
19421942

0 commit comments

Comments
 (0)