Exclude all Redirector templates, not just RedirectorPage

Classes that extend RedirectorPage are still included in the sitemap if exclude_redirector_pages is enabled. This change excludes all subclasses as well.
This commit is contained in:
Mike Cochrane 2016-06-09 13:55:43 +12:00
parent 6fd2901aaf
commit 4701bd985a
1 changed files with 3 additions and 1 deletions

View File

@ -227,7 +227,9 @@ class GoogleSitemap extends Object
}
if($redirector) {
$instances = $instances->exclude('ClassName', 'RedirectorPage');
foreach (ClassInfo::subclassesFor('RedirectorPage') as $redirectorClass) {
$instances = $instances->exclude('ClassName', $redirectorClass);
}
}
} elseif ($class == "GoogleSitemapRoute") {
$instances = array_slice(self::$routes, ($page - 1) * $count, $count);