Fix to force all Page::taxonomy to be treated as strings #2446

This commit is contained in:
Andy Miller
2019-04-13 13:53:46 -06:00
parent 8fd7a5aebe
commit 14eb1281f9
2 changed files with 5 additions and 3 deletions

View File

@@ -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

View File

@@ -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;
}