Minor refactor of webmention_extract_urls in functions.php
Closed this issue · 0 comments
shawfactor commented
id suggest on line 305 of
this would be a more appropriate, full proof, and efficient check for $content would be
// If no content is provided, or if it is not html and therefore won't contain urls
$content = trim($content);
if (empty($content) or ($content == strip_tags(wp_strip_all_tags))){
return array();
}
I would also suggest a sanity check that $doc is a type DOMDocument before:
$xpath = new DOMXPath( $doc );
on line 316
as get_dom_document can return a WP_Error and that generates a fatal error which is not ideal