Merge pull request #184 from Zazama/main

This commit is contained in:
Will Rossiter 2022-07-29 05:56:34 +12:00 committed by GitHub
commit cfcb002cf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,11 +68,11 @@ class GoogleSitemapController extends Controller
public function sitemap()
{
$class = $this->unsanitiseClassName($this->request->param('ID'));
$page = $this->request->param('OtherID');
$page = intval($this->request->param('OtherID'));
if (GoogleSitemap::enabled()
&& $class
&& $page
&& ($page > 0)
&& ($class == SiteTree::class || $class == 'GoogleSitemapRoute' || GoogleSitemap::is_registered($class))
) {
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');