MINOR: #2523 - Removing ErrorPages from sitemap.xml (christian)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56951 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-06-25 06:08:27 +00:00
parent 87a43ce8c1
commit 693c2a3c51

View File

@ -1,4 +1,5 @@
<?php
/**
* Initial implementation of Sitemap support.
* GoogleSitemap should handle requests to 'sitemap.xml'
@ -15,8 +16,8 @@ class GoogleSitemap extends Controller {
$newPages = new DataObjectSet();
foreach($this->Pages as $page) {
// Only include pages from this host
if(parse_url($page->AbsoluteLink(), PHP_URL_HOST) == $_SERVER['HTTP_HOST']) {
// Only include pages from this host and pages which are not an instance of ErrorPage
if(parse_url($page->AbsoluteLink(), PHP_URL_HOST) == $_SERVER['HTTP_HOST'] && !($page instanceof ErrorPage)) {
// If the page has been set to 0 priority, we set a flag so it won't be included
if(isset($page->Priority) && $page->Priority <= 0) {