Commit f98fd49d authored by catch's avatar catch

Issue #2332427 by neclimdul: Fixed APCUBackend makes incorrect assumptions...

Issue #2332427 by neclimdul: Fixed APCUBackend makes incorrect assumptions about apc_fetch return type.
parent ea561c10
......@@ -109,10 +109,12 @@ public function getMultiple(&$cids, $allow_invalid = FALSE) {
$result = apc_fetch(array_keys($map));
$cache = array();
foreach ($result as $key => $item) {
$item = $this->prepareItem($item, $allow_invalid);
if ($item) {
$cache[$map[$key]] = $item;
if ($result) {
foreach ($result as $key => $item) {
$item = $this->prepareItem($item, $allow_invalid);
if ($item) {
$cache[$map[$key]] = $item;
}
}
}
unset($result);
......@@ -358,8 +360,10 @@ protected function checksumTags(array $tags) {
foreach (array('deletions', 'invalidations') as $type) {
if ($query_tags[$type]) {
$result = apc_fetch($query_tags[$type]);
static::$tagCache[$type] = array_merge(static::$tagCache[$type], $result);
$checksum[$type] += array_sum($result);
if ($result) {
static::$tagCache[$type] = array_merge(static::$tagCache[$type], $result);
$checksum[$type] += array_sum($result);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment