To prevent non-XML or corrupted XML results from escalating a parse error in SimpleXML to a fatal error in PHP, we can wrap the 200 status code attempt in a try-catch block also.
To be fair, i only run into this, and want to fix it, because when i develop on buses or somewhere that injects ad code or has a signup page that corruption takes out the site if i have internet on. But still, it's conceivable that Amazon's XML could be corrupted, and there's no reason for something like an "other products you might enjoy" sidebar block taking down one's entire site.
Comments
Comment #1
mlncn commentedAnd here's a patch.