mirror of
https://github.com/friendica/friendica
synced 2025-04-27 17:10:10 +00:00
Some more "convertForUriId" replacements
This commit is contained in:
parent
c151376596
commit
07d2dfcd60
15 changed files with 33 additions and 133 deletions
|
@ -1345,8 +1345,7 @@ class Receiver
|
|||
// Some AP software allow formatted text in post location, so we run all the text converters we have to boil
|
||||
// down to HTML and then finally format to plaintext.
|
||||
$location = Markdown::convert($location);
|
||||
$location = BBCode::convert($location);
|
||||
$location = HTML::toPlaintext($location);
|
||||
$location = BBCode::toPlaintext($location);
|
||||
}
|
||||
|
||||
$object_data['sc:identifier'] = JsonLD::fetchElement($object, 'sc:identifier', '@value');
|
||||
|
|
|
@ -345,7 +345,7 @@ class Transmitter
|
|||
}
|
||||
|
||||
if (!empty($owner['about'])) {
|
||||
$data['summary'] = BBCode::convert($owner['about'], false);
|
||||
$data['summary'] = BBCode::convertForUriId($owner['uri-id'], $owner['about'], BBCode::EXTERNAL);
|
||||
}
|
||||
|
||||
$data['url'] = $owner['url'];
|
||||
|
|
|
@ -765,12 +765,13 @@ class DFRN
|
|||
* @param DOMDocument $doc XML document
|
||||
* @param string $element Element name for the activity
|
||||
* @param string $activity activity value
|
||||
* @param int $uriid Uri-Id of the post
|
||||
*
|
||||
* @return \DOMElement XML activity object
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @todo Find proper type-hints
|
||||
*/
|
||||
private static function createActivity(DOMDocument $doc, $element, $activity)
|
||||
private static function createActivity(DOMDocument $doc, $element, $activity, $uriid)
|
||||
{
|
||||
if ($activity) {
|
||||
$entry = $doc->createElement($element);
|
||||
|
@ -817,7 +818,7 @@ class DFRN
|
|||
}
|
||||
}
|
||||
if ($r->content) {
|
||||
XML::addElement($doc, $entry, "content", BBCode::convert($r->content), ["type" => "html"]);
|
||||
XML::addElement($doc, $entry, "content", BBCode::convertForUriId($uriid, $r->content, BBCode::EXTERNAL), ["type" => "html"]);
|
||||
}
|
||||
|
||||
return $entry;
|
||||
|
@ -918,7 +919,7 @@ class DFRN
|
|||
$htmlbody = "[b]" . $item['title'] . "[/b]\n\n" . $htmlbody;
|
||||
}
|
||||
|
||||
$htmlbody = BBCode::convertForUriId($item['uri-id'], $htmlbody, BBCode::OSTATUS);
|
||||
$htmlbody = BBCode::convertForUriId($item['uri-id'], $htmlbody, BBCode::ACTIVITYPUB);
|
||||
}
|
||||
|
||||
$author = self::addEntryAuthor($doc, "author", $item["author-link"], $item);
|
||||
|
@ -1033,12 +1034,12 @@ class DFRN
|
|||
XML::addElement($doc, $entry, "activity:object-type", Activity\ObjectType::COMMENT);
|
||||
}
|
||||
|
||||
$actobj = self::createActivity($doc, "activity:object", $item['object']);
|
||||
$actobj = self::createActivity($doc, "activity:object", $item['object'], $item['uri-id']);
|
||||
if ($actobj) {
|
||||
$entry->appendChild($actobj);
|
||||
}
|
||||
|
||||
$actarg = self::createActivity($doc, "activity:target", $item['target']);
|
||||
$actarg = self::createActivity($doc, "activity:target", $item['target'], $item['uri-id']);
|
||||
if ($actarg) {
|
||||
$entry->appendChild($actarg);
|
||||
}
|
||||
|
|
|
@ -1109,7 +1109,7 @@ class Feed
|
|||
|
||||
$body = OStatus::formatPicturePost($item['body'], $item['uri-id']);
|
||||
|
||||
$body = BBCode::convertForUriId($item['uri-id'], $body, BBCode::OSTATUS, false);
|
||||
$body = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);
|
||||
|
||||
XML::addElement($doc, $entry, "content", $body, ["type" => "html"]);
|
||||
|
||||
|
@ -1186,7 +1186,7 @@ class Feed
|
|||
private static function getTitle(array $item)
|
||||
{
|
||||
if ($item['title'] != '') {
|
||||
return BBCode::convertForUriId($item['uri-id'], $item['title'], BBCode::OSTATUS);
|
||||
return BBCode::convertForUriId($item['uri-id'], $item['title'], BBCode::ACTIVITYPUB);
|
||||
}
|
||||
|
||||
// Fetch information about the post
|
||||
|
|
|
@ -1418,7 +1418,7 @@ class OStatus
|
|||
XML::addElement($doc, $author, "name", $owner["nick"]);
|
||||
XML::addElement($doc, $author, "email", $owner["addr"]);
|
||||
if ($show_profile) {
|
||||
XML::addElement($doc, $author, "summary", BBCode::convert($owner["about"], false, BBCode::OSTATUS));
|
||||
XML::addElement($doc, $author, "summary", BBCode::convertForUriId($owner['uri-id'], $owner["about"], BBCode::OSTATUS));
|
||||
}
|
||||
|
||||
$attributes = ["rel" => "alternate", "type" => "text/html", "href" => $owner["url"]];
|
||||
|
@ -1445,7 +1445,7 @@ class OStatus
|
|||
XML::addElement($doc, $author, "poco:preferredUsername", $owner["nick"]);
|
||||
XML::addElement($doc, $author, "poco:displayName", $owner["name"]);
|
||||
if ($show_profile) {
|
||||
XML::addElement($doc, $author, "poco:note", BBCode::convert($owner["about"], false, BBCode::OSTATUS));
|
||||
XML::addElement($doc, $author, "poco:note", BBCode::convertForUriId($owner['uri-id'], $owner["about"], BBCode::OSTATUS));
|
||||
|
||||
if (trim($owner["location"]) != "") {
|
||||
$element = $doc->createElement("poco:address");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue