Update GoogleSitemapSiteTreeExtension.php

This commit is contained in:
Will Rossiter 2020-11-20 09:46:56 +13:00 committed by GitHub
parent 67c8ad044e
commit 67e8d601d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,15 +163,15 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
foreach ($this->owner->manyMany() as $field => $type) {
$image = false;
if (strpos($type, '.') !== false) {
$type = explode('.', $type)[0];
}
if (is_array($type) && isset($type['through'])) {
if (singleton($type['through']) instanceof Image) {
$image = true;
}
} else {
if (strpos($type, '.') !== false) {
$type = explode('.', $type)[0];
}
if (singleton($type) instanceof Image) {
$image = true;
}