You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should check for $r === FALSE and throw exception after this piece of codes in DOMQuery::parseXMLFile() as load() and loadHTMLFile() methods of DOMDocument can return FALSE on failure:
if ($useParser == 'xml') {
$r = $document->load($filename, $flags);
}
// Otherwise, see if it looks like HTML.
elseif (isset($htmlExtensions[$ext]) || $useParser == 'html') {
// Try parsing it as HTML.
$r = $document->loadHTMLFile($filename);
}
// Default to XML.
else {
$r = $document->load($filename, $flags);
}
The text was updated successfully, but these errors were encountered:
Feel free to open a PR, and I'l take a look. That'd be a fairly big change, and would likely break many applications, so it'd probably require a major version number increment.
You should check for $r === FALSE and throw exception after this piece of codes in DOMQuery::parseXMLFile() as load() and loadHTMLFile() methods of DOMDocument can return FALSE on failure:
The text was updated successfully, but these errors were encountered: