diff --git a/CHANGELOG.md b/CHANGELOG.md index a994d54fd..23f072d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ * Added new `Grav\Framework\File\Formatter` classes for encoding/decoding YAML, Markdown, JSON, INI and PHP serialized strings * Added `Grav\Common\Media` interfaces and trait; use those in `Page` and `Media` classes * Added `Grav\Common\Page` interface to allow custom page types in the future - +1. [](#bugfix) + * Fixed bug in `ContentBlock` serialization + # v1.4.4 ## 04/12/2018 diff --git a/system/src/Grav/Framework/ContentBlock/ContentBlock.php b/system/src/Grav/Framework/ContentBlock/ContentBlock.php index 6229b8151..626e6a2f9 100644 --- a/system/src/Grav/Framework/ContentBlock/ContentBlock.php +++ b/system/src/Grav/Framework/ContentBlock/ContentBlock.php @@ -222,7 +222,7 @@ protected function generateId() */ protected function checkVersion(array $serialized) { - $version = isset($serialized['_version']) ? (string) $serialized['_version'] : '1'; + $version = isset($serialized['_version']) ? (int) $serialized['_version'] : 1; if ($version !== $this->version) { throw new \RuntimeException(sprintf('Unsupported version %s', $version)); } diff --git a/system/src/Grav/Framework/ContentBlock/HtmlBlock.php b/system/src/Grav/Framework/ContentBlock/HtmlBlock.php index 976018a0e..3fd345b8c 100644 --- a/system/src/Grav/Framework/ContentBlock/HtmlBlock.php +++ b/system/src/Grav/Framework/ContentBlock/HtmlBlock.php @@ -15,6 +15,7 @@ */ class HtmlBlock extends ContentBlock implements HtmlBlockInterface { + protected $version = 1; protected $frameworks = []; protected $styles = []; protected $scripts = [];