From 71e1fddc6d0d26717dbc0e5829054e73974393a7 Mon Sep 17 00:00:00 2001 From: ischommer Date: Thu, 18 Dec 2008 21:07:07 +0000 Subject: [PATCH] BUGFIX Hide pages without view permissions from sitemap.xml. Thanks simon_w! (see #3234) --- code/GoogleSitemap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index 15f2361..4001f55 100755 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -44,9 +44,9 @@ class GoogleSitemap extends Controller { foreach($this->Pages as $page) { // 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) { + if($page->canView() && (!isset($page->Priority) || $page->Priority > 0)) { // The one field that isn't easy to deal with in the template is // Change frequency, so we set that here. $properties = $page->toMap();