diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fd5ffa57..8fbd83db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#bugfix) * Rework logic to pull out excluded files from pipeline more reliably [#2445](https://github.com/getgrav/grav/issues/2445) * Better logic in `Utils::normalizePath` to handle externals properly [#2216](https://github.com/getgrav/grav/issues/2216) + * Fix to force all `Page::taxonomy` to be treated as strings [#2446](https://github.com/getgrav/grav/issues/2446) # v1.6.3 ## 04/12/2019 diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index def0bb526..7a4dae480 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -414,9 +414,7 @@ class Page implements PageInterface $this->markdown_extra = (bool)$this->header->markdown_extra; } if (isset($this->header->taxonomy)) { - foreach ((array)$this->header->taxonomy as $taxonomy => $taxitems) { - $this->taxonomy[$taxonomy] = (array)$taxitems; - } + $this->taxonomy($this->header->taxonomy); } if (isset($this->header->max_count)) { $this->max_count = (int)$this->header->max_count; @@ -2296,6 +2294,9 @@ class Page implements PageInterface public function taxonomy($var = null) { if ($var !== null) { + array_walk_recursive($var, function(&$value) { + $value = (string) $value; + }); $this->taxonomy = $var; }