Skip to content

Commit

Permalink
Bug fix on Cache TTL = null
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Jan 19, 2018
1 parent 73bd402 commit 8d39fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions system/src/Grav/Common/Markdown/ParsedownExtra.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions system/src/Grav/Framework/Cache/CacheTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 8d39fdf

Please sign in to comment.