mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Merge pull request #184 from Zazama/main
This commit is contained in:
commit
cfcb002cf3
@ -68,11 +68,11 @@ class GoogleSitemapController extends Controller
|
|||||||
public function sitemap()
|
public function sitemap()
|
||||||
{
|
{
|
||||||
$class = $this->unsanitiseClassName($this->request->param('ID'));
|
$class = $this->unsanitiseClassName($this->request->param('ID'));
|
||||||
$page = $this->request->param('OtherID');
|
$page = intval($this->request->param('OtherID'));
|
||||||
|
|
||||||
if (GoogleSitemap::enabled()
|
if (GoogleSitemap::enabled()
|
||||||
&& $class
|
&& $class
|
||||||
&& $page
|
&& ($page > 0)
|
||||||
&& ($class == SiteTree::class || $class == 'GoogleSitemapRoute' || GoogleSitemap::is_registered($class))
|
&& ($class == SiteTree::class || $class == 'GoogleSitemapRoute' || GoogleSitemap::is_registered($class))
|
||||||
) {
|
) {
|
||||||
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
||||||
|
Loading…
Reference in New Issue
Block a user