Sitemap is being generated with leading spaces causing invalid XML
lopugit opened this issue · 2 comments
lopugit commented
Description
sitemap.xml file is being generated with spaces at the start of the file making it an invalid XML document.
Visit https://sport.unimelb.edu.au/sitemap.xml to see, and view source
Steps to reproduce
- Install SEO plugin
- Generate sitemap
Additional info
- Craft version: 3.7.46
- SEO version: 3.7.4
- PHP version: 8.0.18
- Database driver & version:
- Other Plugins:
lopugit commented
I've investigated this a bit and found that no matter what $response->content
is set to in XmlController.php
it always adds spaces at the start of the XML response. Is this an issue with \Craft::$app->getResponse();
?
lopugit commented
Turned out to be some leading spaces added before a <?php tag in the routes file