aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Articles.php2
-rw-r--r--Zotlabs/Module/Channel.php16
2 files changed, 15 insertions, 3 deletions
diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php
index e3ad54be8..2c43b4764 100644
--- a/Zotlabs/Module/Articles.php
+++ b/Zotlabs/Module/Articles.php
@@ -211,7 +211,7 @@ class Articles extends Controller {
}
// Add Opengraph markup
- opengraph_add_meta(((! empty($items)) ? $r[0] : array()), App::$profile);
+ opengraph_add_meta((! empty($items) ? $r[0] : []), $channel);
$mode = 'articles';
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 3f617fd18..6034bd7da 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -110,8 +110,20 @@ class Channel extends Controller {
// Run profile_load() here to make sure the theme is set before
// we start loading content
-
profile_load($which,$profile);
+
+ // Add Opengraph markup
+ $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
+ if(strpos($mid,'b64.') === 0)
+ $mid = @base64url_decode(substr($mid,4));
+
+ if($mid)
+ $r = q("SELECT * FROM item WHERE mid = '%s' AND uid = %d AND item_private = 0 LIMIT 1",
+ dbesc($mid),
+ intval($channel['channel_id'])
+ );
+
+ opengraph_add_meta($r ? $r[0] : [], $channel);
}
function get($update = 0, $load = false) {
@@ -376,7 +388,7 @@ class Channel extends Controller {
}
// Add Opengraph markup
- opengraph_add_meta((isset($decoded) && (! empty($items)) ? $r[0] : array()), App::$profile);
+ opengraph_add_meta((! empty($items) ? $r[0] : array()), App::$profile);
if((! $update) && (! $load)) {