mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
lemmy attached pages (again)
This commit is contained in:
parent
19d42dbb9f
commit
854ee1049c
1 changed files with 37 additions and 24 deletions
|
@ -3519,35 +3519,48 @@ class Activity
|
||||||
} else {
|
} else {
|
||||||
$ptr = [$act->obj['url']];
|
$ptr = [$act->obj['url']];
|
||||||
}
|
}
|
||||||
foreach ($ptr as $vurl) {
|
|
||||||
if (! is_array($vurl)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (array_key_exists('mediaType', $vurl) && $vurl['mediaType'] === 'text/html') {
|
|
||||||
$purl = $vurl['href'];
|
|
||||||
break;
|
|
||||||
} elseif (array_key_exists('mimeType', $vurl) && $vurl['mimeType'] === 'text/html') {
|
|
||||||
$purl = $vurl['href'];
|
|
||||||
break;
|
|
||||||
} elseif ($item['mimetype'] === 'text/html') {
|
|
||||||
// lemmy makes everything difficult to parse; this time by putting the mediaType on the object but not the link
|
|
||||||
// we can target this specifically because there's a mediaType set on the object but no content could be found.
|
|
||||||
$purl = $vurl['href'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (is_string($act->obj['url'])) {
|
|
||||||
$purl = $act->obj['url'];
|
|
||||||
}
|
}
|
||||||
if ($purl) {
|
}
|
||||||
$li = Url::get(z_root() . '/linkinfo?binurl=' . bin2hex($purl));
|
elseif (array_key_exists('attachment', $act->obj)) {
|
||||||
if ($li['success'] && $li['body']) {
|
if (is_array($act->obj['attachment'])) {
|
||||||
$item['body'] .= "\n" . $li['body'];
|
if (array_key_exists(0, $act->obj['attachment'])) {
|
||||||
|
$ptr = $act->obj['attachement'];
|
||||||
} else {
|
} else {
|
||||||
$item['body'] .= "\n\n" . $purl;
|
$ptr = [$act->obj['attachement']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($ptr) {
|
||||||
|
foreach ($ptr as $vurl) {
|
||||||
|
if (! is_array($vurl)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (array_key_exists('mediaType', $vurl) && $vurl['mediaType'] === 'text/html') {
|
||||||
|
$purl = $vurl['href'];
|
||||||
|
break;
|
||||||
|
} elseif (array_key_exists('mimeType', $vurl) && $vurl['mimeType'] === 'text/html') {
|
||||||
|
$purl = $vurl['href'];
|
||||||
|
break;
|
||||||
|
} elseif ($item['mimetype'] === 'text/html') {
|
||||||
|
// lemmy makes everything difficult to parse; this time by putting the mediaType on the object but not the link
|
||||||
|
// we can target this specifically because there's a mediaType set on the object but no content could be found.
|
||||||
|
$purl = $vurl['href'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif (is_string($act->obj['url'])) {
|
||||||
|
$purl = $act->obj['url'];
|
||||||
|
} elseif (is_string($act->obj['attachment'])) {
|
||||||
|
$purl = $act->obj['attachment'];
|
||||||
|
}
|
||||||
|
if ($purl) {
|
||||||
|
$li = Url::get(z_root() . '/linkinfo?binurl=' . bin2hex($purl));
|
||||||
|
if ($li['success'] && $li['body']) {
|
||||||
|
$item['body'] .= "\n" . $li['body'];
|
||||||
|
} else {
|
||||||
|
$item['body'] .= "\n\n" . $purl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue