Skip to content

Commit 5724878

Browse files
committed
Use default value for memcached servers if blank
Since everywhere else uses the default value, we also need to use the default in object-cache.php. This is pretty safe because the object-cache.php should not get installed without a validated connection.
1 parent 308b7fd commit 5724878

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/drop-in/object-cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public static function getServersFromConfig(): array {
191191
}
192192

193193
// If SNAPCACHE_MEMCACHED_SERVERS is not set,
194-
// try to look it up an option from the
194+
// try to look up an option from the
195195
// DB. We can do this because any competent
196196
// host will keep persistent connections,
197197
// so we won't do this query for most requests.
@@ -207,7 +207,7 @@ public static function getServersFromConfig(): array {
207207
'snapcache_memcached_servers'
208208
)
209209
);
210-
$raw = $result ? maybe_unserialize( $result ) : '';
210+
$raw = $result ? maybe_unserialize( $result ) : 'localhost:11211';
211211
// Since the admin may type servers in a textarea, we want
212212
// to ignore blank lines and extra whitespace.
213213
$lines = array_map( trim( ... ), explode( "\n", $raw ) );

0 commit comments

Comments
 (0)