Skip to content

Commit

Permalink
Fix to force all Page::taxonomy to be treated as strings #2446
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 13, 2019
1 parent 8fd7a5a commit 14eb128
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ public function header($var = null)
$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;
Expand Down Expand Up @@ -2296,6 +2294,9 @@ public function maxCount($var = null)
public function taxonomy($var = null)
{
if ($var !== null) {
array_walk_recursive($var, function(&$value) {
$value = (string) $value;
});
$this->taxonomy = $var;
}

Expand Down

0 comments on commit 14eb128

Please sign in to comment.