album sharing continued

This commit is contained in:
Mike Macgirvin 2024-06-12 14:30:01 +10:00
parent be54822df1
commit f85143cb36
3 changed files with 6 additions and 4 deletions

View file

@ -248,8 +248,8 @@ function html2bbcode($message)
node2bbcode($doc, 'a', array('href' => '/(.+)/'), '[url=$1]', '[/url]'); node2bbcode($doc, 'a', array('href' => '/(.+)/'), '[url=$1]', '[/url]');
node2bbcode($doc, 'img', array('src' => '/(.+)/', 'width' => '/(\d+)/', 'height' => '/(\d+)/', 'alt' => '/(.+)/'), '[img width=\'$2\' height=\'$3\' src=\'$1\' alt=\'$4\']', '[/img]'); node2bbcode($doc, 'img', array('src' => '/(.+)/', 'width' => '/(\d+)/', 'height' => '/(\d+)/', 'alt' => '/(.+)/'), '[img width=\'$2\' height=\'$3\' alt=\'$4\']$1', '[/img]');
node2bbcode($doc, 'img', array('src' => '/(.+)/', 'alt' => '/(.+)/'), '[img src=\'$1\' alt=\'$2\']', '[/img]'); node2bbcode($doc, 'img', array('src' => '/(.+)/', 'alt' => '/(.+)/'), '[img alt=\'$2\']$1', '[/img]');
node2bbcode($doc, 'img', array('src' => '/(.+)/', 'width' => '/(\d+)/', 'height' => '/(\d+)/'), '[img=$2x$3]$1', '[/img]'); node2bbcode($doc, 'img', array('src' => '/(.+)/', 'width' => '/(\d+)/', 'height' => '/(\d+)/'), '[img=$2x$3]$1', '[/img]');
node2bbcode($doc, 'img', array('src' => '/(.+)/'), '[img]$1', '[/img]'); node2bbcode($doc, 'img', array('src' => '/(.+)/'), '[img]$1', '[/img]');

View file

@ -104,7 +104,7 @@ class Album extends Controller
$collection = fetch_post_tags($collection); $collection = fetch_post_tags($collection);
} }
$obj = Activity::encode_photo_collection($collection, App::$query_string, 'Collection', true, z_root() . '/channel/' . $channel['channel_hash'], count($collection)); $obj = Activity::encode_photo_collection($collection, App::$query_string, 'Collection', true, z_root() . '/channel/' . $channel['channel_address'], count($collection));
$obj['content'] = bbcode($obj['content'], ['export' => true]); $obj['content'] = bbcode($obj['content'], ['export' => true]);
as_return_and_die($obj, $channel); as_return_and_die($obj, $channel);
} }

View file

@ -229,7 +229,7 @@ class Linkinfo extends Controller
$y = new ActivityStreams($x); $y = new ActivityStreams($x);
if ( if (
$y->is_valid() && $y->type === 'Announce' && is_array($y->obj) $y->is_valid() && $y->type === 'Announce' && is_array($y->obj)
&& (array_key_exists('object', $AS->obj) || array_key_exists('target', $AS->obj)) && array_key_exists('actor', $y->obj) && (array_key_exists('object', $y->obj) || array_key_exists('target', $y->obj)) && array_key_exists('actor', $y->obj)
) { ) {
// This is a relayed/forwarded Activity (as opposed to a shared/boosted object) // This is a relayed/forwarded Activity (as opposed to a shared/boosted object)
// Reparse the encapsulated Activity and use that instead // Reparse the encapsulated Activity and use that instead
@ -265,6 +265,8 @@ class Linkinfo extends Controller
} }
} }
} }
if ($process_oembed) { if ($process_oembed) {
$x = Oembed::process($url); $x = Oembed::process($url);
if ($x) { if ($x) {