Merge pull request #179 from td204/2.2.0-fixAlterCanInclude

response was array, need to check boolean value
This commit is contained in:
Will Rossiter 2023-07-19 21:16:34 +12:00 committed by GitHub
commit 9b0e0f1064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,10 @@ class GoogleSitemapExtension extends DataExtension
} }
} }
if (is_array($can) && isset($can[0])) {
return $can[0];
}
return $can; return $can;
} }

View File

@ -104,6 +104,10 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
$result = parent::canIncludeInGoogleSitemap(); $result = parent::canIncludeInGoogleSitemap();
$result = ($this->owner instanceof ErrorPage) ? false : $result; $result = ($this->owner instanceof ErrorPage) ? false : $result;
if (is_array($result) && isset($result[0])) {
return $result[0];
}
return $result; return $result;
} }