mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
87a43ce8c1
commit
693c2a3c51
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial implementation of Sitemap support.
|
* Initial implementation of Sitemap support.
|
||||||
* GoogleSitemap should handle requests to 'sitemap.xml'
|
* GoogleSitemap should handle requests to 'sitemap.xml'
|
||||||
@ -15,8 +16,8 @@ class GoogleSitemap extends Controller {
|
|||||||
$newPages = new DataObjectSet();
|
$newPages = new DataObjectSet();
|
||||||
|
|
||||||
foreach($this->Pages as $page) {
|
foreach($this->Pages as $page) {
|
||||||
// Only include pages from this 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']) {
|
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 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) {
|
if(isset($page->Priority) && $page->Priority <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user