mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Merge pull request #179 from td204/2.2.0-fixAlterCanInclude
response was array, need to check boolean value
This commit is contained in:
commit
9b0e0f1064
@ -66,6 +66,10 @@ class GoogleSitemapExtension extends DataExtension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($can) && isset($can[0])) {
|
||||||
|
return $can[0];
|
||||||
|
}
|
||||||
|
|
||||||
return $can;
|
return $can;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user