mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-42839 MUC: Memcache server configuration too sensitive to whitespace
This commit is contained in:
parent
d214057cad
commit
5c138b258d
7
cache/stores/memcache/lib.php
vendored
7
cache/stores/memcache/lib.php
vendored
@ -350,7 +350,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
$lines = explode("\n", $data->servers);
|
||||
$servers = array();
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line, ':');
|
||||
// Trim surrounding colons and default whitespace.
|
||||
$line = trim(trim($line), ":");
|
||||
// Skip blank lines.
|
||||
if ($line === '') {
|
||||
continue;
|
||||
}
|
||||
$servers[] = explode(':', $line, 3);
|
||||
}
|
||||
return array(
|
||||
|
7
cache/stores/memcached/lib.php
vendored
7
cache/stores/memcached/lib.php
vendored
@ -374,7 +374,12 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
|
||||
$lines = explode("\n", $data->servers);
|
||||
$servers = array();
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line, ':');
|
||||
// Trim surrounding colons and default whitespace.
|
||||
$line = trim(trim($line), ":");
|
||||
// Skip blank lines.
|
||||
if ($line === '') {
|
||||
continue;
|
||||
}
|
||||
$servers[] = explode(':', $line, 3);
|
||||
}
|
||||
return array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user