dpovshed / octopus

Sitemap checker/stress test tool based on ReactPHP
11 stars 1 forks source link

Gracefully deal with empty XML Sitemaps #36

Closed holtkamp closed 5 years ago

holtkamp commented 5 years ago

Empty XML Sitemaps are currently not detected properly.

This causes the XML that "is" available to be parsed as raw TXT, causing errors like:

[error] loading <?xml version="1.0" encoding="UTF-8"?> resulted in an error: failure, Sending request requires absolute URI with scheme and host
[error] loading <urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"/> resulted in an error: failure, Sending request requires absolute URI with scheme and host

The cause is seems that an SimpleXMLElement without any children is considered NULL