mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Convert in GoogleSitemapController to int, avoid 500 errors on non-nomeric values
This commit is contained in:
parent
cb56ac11d9
commit
0e965ecd46
@ -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"');
|
||||
|
Loading…
Reference in New Issue
Block a user