Skip to content
Permalink
Browse files

MDL-42839 MUC: Memcache server configuration too sensitive to whitespace

  • Loading branch information...
sammarshallou committed Nov 12, 2013
1 parent e81fce9 commit 903c5bf341e544dd99223a91458d18fd404eecd9
Showing with 12 additions and 2 deletions.
  1. +6 −1 cache/stores/memcache/lib.php
  2. +6 −1 cache/stores/memcached/lib.php
@@ -350,7 +350,12 @@ public static function config_get_configuration_array($data) {
$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(
@@ -374,7 +374,12 @@ public static function config_get_configuration_array($data) {
$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(

0 comments on commit 903c5bf

Please sign in to comment.
You can’t perform that action at this time.