if (class_exists('DOMXpath'
) &&
function_exists('Mf2\parse'
)) { $doc =
new DOMDocument();
@
$doc->
loadHTML($data);
$xpath =
new DOMXpath($doc);
// Check for both h-feed and h-entry, as both a feed with no entries
// and a list of entries without an h-feed wrapper are both valid.
$query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
'contains(concat(" ", @class, " "), " h-entry ")]';
$result =
$xpath->
query($query);
if ($result->length !== 0
) { return $this->
parse_microformats($data,
$url);
} } // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
if (strtoupper($encoding) === 'US-ASCII'
) { $this->encoding = 'UTF-8';
} else { $this->encoding =
$encoding;
}