BUGFIX: Fixed issue where classes not in the sitemap would cause a crash

This commit is contained in:
UndefinedOffset 2016-06-29 13:58:07 -03:00
parent 49053f7d8f
commit 26838c70d0
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ class GoogleSitemapController extends Controller
$class = $this->unsanitiseClassName($this->request->param('ID'));
$page = $this->request->param('OtherID');
if (GoogleSitemap::enabled() && $class && $page) {
if (GoogleSitemap::enabled() && $class && $page && ($class=='SiteTree' || GoogleSitemap::is_registered($class))) {
Config::inst()->update('SSViewer', 'set_source_file_comments', false);
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');