aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-20 17:45:08 -0700
committerzotlabs <mike@macgirvin.com>2017-08-20 17:45:08 -0700
commit8a5c23fd50d26fb44d3d1d0f11d3bbd23872d060 (patch)
treea4aae5165fc86a8019e10ba14cf693a46c4f52a4 /Zotlabs/Module
parented71afa6c7ada8ae972474f1846932032c782a94 (diff)
downloadvolse-hubzilla-8a5c23fd50d26fb44d3d1d0f11d3bbd23872d060.tar.gz
volse-hubzilla-8a5c23fd50d26fb44d3d1d0f11d3bbd23872d060.tar.bz2
volse-hubzilla-8a5c23fd50d26fb44d3d1d0f11d3bbd23872d060.zip
issue with oembed of a shared item, which wraps in another share.
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Oep.php30
1 files changed, 20 insertions, 10 deletions
diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php
index 9c05f5e3f..07094c1de 100644
--- a/Zotlabs/Module/Oep.php
+++ b/Zotlabs/Module/Oep.php
@@ -151,19 +151,29 @@ class Oep extends \Zotlabs\Web\Controller {
xchan_query($p,true);
$p = fetch_post_tags($p,true);
-
+
+ // This function can get tripped up if the item is already a reshare
+ // (the multiple share declarations do not parse cleanly if nested)
+ // So build a template with a known nonsense string as the content, and then
+ // replace that known string with the actual rendered content, sending
+ // each content layer through bbcode() separately.
+
+ $x = '2eGriplW^*Jmf4';
+
$o = "[share author='".urlencode($p[0]['author']['xchan_name']).
- "' profile='".$p[0]['author']['xchan_url'] .
- "' avatar='".$p[0]['author']['xchan_photo_s'].
- "' link='".$p[0]['plink'].
- "' posted='".$p[0]['created'].
- "' message_id='".$p[0]['mid']."']";
- if($p[0]['title'])
- $o .= '[b]'.$p[0]['title'].'[/b]'."\r\n";
- $o .= $p[0]['body'];
- $o .= "[/share]";
+ "' profile='".$p[0]['author']['xchan_url'] .
+ "' avatar='".$p[0]['author']['xchan_photo_s'].
+ "' link='".$p[0]['plink'].
+ "' posted='".$p[0]['created'].
+ "' message_id='".$p[0]['mid']."']";
+ if($p[0]['title'])
+ $o .= '[b]'.$p[0]['title'].'[/b]'."\r\n";
+ $o .= $x;
+ $o .= "[/share]";
$o = bbcode($o);
+ $o = str_replace($x,bbcode($p[0]['body']),$o);
+
$ret['type'] = 'rich';
$w = (($maxwidth) ? $maxwidth : 640);