diff --git a/code/controllers/GoogleSitemapController.php b/code/controllers/GoogleSitemapController.php index c84c860..db06e2e 100644 --- a/code/controllers/GoogleSitemapController.php +++ b/code/controllers/GoogleSitemapController.php @@ -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"');