mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed CompiledJsonFile as it was not caching properly
This commit is contained in:
parent
e73773672b
commit
491e73eade
|
|
@ -14,19 +14,15 @@ class CompiledJsonFile extends JsonFile
|
|||
{
|
||||
use CompiledFile;
|
||||
|
||||
public function content($var = null, $assoc = false)
|
||||
/**
|
||||
* Decode RAW string into contents.
|
||||
*
|
||||
* @param string $var
|
||||
* @param bool $assoc
|
||||
* @return array mixed
|
||||
*/
|
||||
protected function decode($var, $assoc = true)
|
||||
{
|
||||
if ($var !== null) {
|
||||
$this->content = $this->check($var);
|
||||
|
||||
// Update RAW, too.
|
||||
$this->raw = $this->encode($this->content);
|
||||
|
||||
} elseif ($this->content === null) {
|
||||
// Decode RAW file.
|
||||
$this->content = $this->decode($this->raw(), $assoc);
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
return (array) json_decode($var, $assoc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user