We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8043880 + 155c2f4 commit faba415Copy full SHA for faba415
OpenGraph.php
@@ -125,6 +125,20 @@ static private function _parse($HTML) {
125
$page->_values['description'] = $nonOgDescription;
126
}
127
128
+ //Fallback to use image_src if ogp::image isn't set.
129
+ if (!isset($page->values['image'])) {
130
+ $domxpath = new DOMXPath($doc);
131
+ $elements = $domxpath->query("//link[@rel='image_src']");
132
+
133
+ if ($elements->length > 0) {
134
+ $domattr = $elements->item(0)->attributes->getNamedItem('href');
135
+ if ($domattr) {
136
+ $page->_values['image'] = $domattr->value;
137
+ $page->_values['image_src'] = $domattr->value;
138
+ }
139
140
141
142
if (empty($page->_values)) { return false; }
143
144
return $page;
0 commit comments