mirror of
https://github.com/getgrav/grav.git
synced 2026-07-05 09:48:29 +02:00
fix exception array_merge() when $this->header->metadata is not array (#2701)
Exception gets thrown when $this->header->metadata is not an array, added extra verification in order to make sure it is and array before doing array_merge()
This commit is contained in:
@@ -1696,7 +1696,7 @@ class Page implements PageInterface
|
||||
// Get initial metadata for the page
|
||||
$metadata = array_merge($metadata, Grav::instance()['config']->get('site.metadata'));
|
||||
|
||||
if (isset($this->header->metadata)) {
|
||||
if (isset($this->header->metadata) && is_array($this->header->metadata)) {
|
||||
// Merge any site.metadata settings in with page metadata
|
||||
$metadata = array_merge($metadata, $this->header->metadata);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user