From b9f1741ea1a71bd92272fd016be14095a6e2037c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 20 Jan 2021 00:05:56 +0200 Subject: [PATCH] Fixed fatal error when `site.taxonomies` contains a bad value --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Taxonomy.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef9247e9..718e52ec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.1 +## mm/dd/2021 + +1. [](#bugfix) + * Fixed fatal error when `site.taxonomies` contains a bad value + # v1.7.0 ## 01/19/2021 diff --git a/system/src/Grav/Common/Taxonomy.php b/system/src/Grav/Common/Taxonomy.php index 815c7f9ed..b21c82fa5 100644 --- a/system/src/Grav/Common/Taxonomy.php +++ b/system/src/Grav/Common/Taxonomy.php @@ -74,6 +74,10 @@ class Taxonomy $config = $this->grav['config']; $taxonomies = (array)$config->get('site.taxonomies'); foreach ($taxonomies as $taxonomy) { + // Skip invalid taxonomies. + if (!\is_string($taxonomy)) { + continue; + } $current = $page_taxonomy[$taxonomy] ?? null; foreach ((array)$current as $item) { $this->iterateTaxonomy($page, $taxonomy, '', $item);