Skip to content

Commit

Permalink
Fix lifetimes passed as string "false" from layout XML
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Besirovic committed Jul 26, 2018
1 parent 91d949e commit bc63e72
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Cm/Cache/Backend/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,25 @@ public function test($id)
return ($mtime ? $mtime : FALSE);
}

/**
* Get the life time
*
* if $specificLifetime is not false, the given specific life time is used
* else, the global lifetime is used
*
* @param int $specificLifetime
* @return int Cache life time
*/
public function getLifetime($specificLifetime)
{
// Lifetimes set via Layout XMLs get parsed as string so bool(false) becomes string("false")
if ($specificLifetime === 'false') {
$specificLifetime = false;
}

return parent::getLifetime($specificLifetime);
}

/**
* Save some string datas into a cache record
*
Expand Down

0 comments on commit bc63e72

Please sign in to comment.