diff --git a/include/opengraph.php b/include/opengraph.php
index 2d72ffca1..ba97d4f4f 100644
--- a/include/opengraph.php
+++ b/include/opengraph.php
@@ -21,8 +21,10 @@
$ogtitle = $item['title'];
// find first image if exist
- if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches))
+ if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches)) {
$ogimage = $matches[2];
+ $ogimagetype = guess_image_type($ogimage);
+ }
// use summary as description if exist
$ogdesc = (empty($item['summary']) ? $item['body'] : $item['summary'] );
@@ -57,12 +59,14 @@
}
}
- if(! isset($ogimage))
+ if(! isset($ogimage)) {
$ogimage = $channel['xchan_photo_l'];
+ $ogimagetype = $channel['xchan_photo_mimetype'];
+ }
App::$page['htmlhead'] .= '' . "\r\n";
App::$page['htmlhead'] .= '' . "\r\n";
- App::$page['htmlhead'] .= '' . "\r\n";
+ App::$page['htmlhead'] .= '' . "\r\n";
App::$page['htmlhead'] .= '' . "\r\n";
App::$page['htmlhead'] .= '' . "\r\n";