@@ -24,6 +24,12 @@ class OGPResolver implements Resolver
|
||||
$metadata = new Metadata();
|
||||
|
||||
$metadata->title = $this->findContent($xpath, '//meta[@*="og:title"]', '//meta[@*="twitter:title"]');
|
||||
if (empty($metadata->title)) {
|
||||
$nodes = $xpath->query('//title');
|
||||
if ($nodes->length !== 0) {
|
||||
$metadata->title = $nodes->item(0)->textContent;
|
||||
}
|
||||
}
|
||||
$metadata->description = $this->findContent($xpath, '//meta[@*="og:description"]', '//meta[@*="twitter:description"]');
|
||||
$metadata->image = $this->findContent($xpath, '//meta[@*="og:image"]', '//meta[@*="twitter:image"]');
|
||||
|
||||
|
Reference in New Issue
Block a user