From 8d39fdf23cde2a8154f739edf7b39567e9af0b4c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 19 Jan 2018 12:53:33 +0200 Subject: [PATCH] Bug fix on Cache TTL = null --- system/src/Grav/Common/Markdown/ParsedownExtra.php | 2 ++ system/src/Grav/Framework/Cache/CacheTrait.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Markdown/ParsedownExtra.php b/system/src/Grav/Common/Markdown/ParsedownExtra.php index 5d0799e02..481c52f1d 100644 --- a/system/src/Grav/Common/Markdown/ParsedownExtra.php +++ b/system/src/Grav/Common/Markdown/ParsedownExtra.php @@ -17,10 +17,12 @@ class ParsedownExtra extends \ParsedownExtra * * @param $page * @param $defaults + * @throws \Exception */ public function __construct($page, $defaults) { parent::__construct(); + $this->init($page, $defaults); } } diff --git a/system/src/Grav/Framework/Cache/CacheTrait.php b/system/src/Grav/Framework/Cache/CacheTrait.php index 7fb37c1f9..65f4d8d40 100644 --- a/system/src/Grav/Framework/Cache/CacheTrait.php +++ b/system/src/Grav/Framework/Cache/CacheTrait.php @@ -85,7 +85,7 @@ public function set($key, $value, $ttl = null) $ttl = $this->convertTtl($ttl); // If a negative or zero TTL is provided, the item MUST be deleted from the cache. - return $ttl <= 0 ? $this->doDelete($key) : $this->doSet($key, $value, $ttl); + return null !== $ttl && $ttl <= 0 ? $this->doDelete($key) : $this->doSet($key, $value, $ttl); } /** @@ -175,7 +175,7 @@ public function setMultiple($values, $ttl = null) $ttl = $this->convertTtl($ttl); // If a negative or zero TTL is provided, the item MUST be deleted from the cache. - return $ttl <= 0 ? $this->doDeleteMultiple($keys) : $this->doSetMultiple($values, $ttl); + return null !== $ttl && $ttl <= 0 ? $this->doDeleteMultiple($keys) : $this->doSetMultiple($values, $ttl); } /**