Skip to content

Commit bc63e72

Browse files
author
Armin Besirovic
committed
Fix lifetimes passed as string "false" from layout XML
1 parent 91d949e commit bc63e72

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Cm/Cache/Backend/Redis.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,25 @@ public function test($id)
477477
return ($mtime ? $mtime : FALSE);
478478
}
479479

480+
/**
481+
* Get the life time
482+
*
483+
* if $specificLifetime is not false, the given specific life time is used
484+
* else, the global lifetime is used
485+
*
486+
* @param int $specificLifetime
487+
* @return int Cache life time
488+
*/
489+
public function getLifetime($specificLifetime)
490+
{
491+
// Lifetimes set via Layout XMLs get parsed as string so bool(false) becomes string("false")
492+
if ($specificLifetime === 'false') {
493+
$specificLifetime = false;
494+
}
495+
496+
return parent::getLifetime($specificLifetime);
497+
}
498+
480499
/**
481500
* Save some string datas into a cache record
482501
*

0 commit comments

Comments
 (0)