mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Improve the code
This commit is contained in:
parent
bf76b43330
commit
304b52ec0f
1 changed files with 2 additions and 2 deletions
|
@ -1346,7 +1346,7 @@ class Transmitter
|
|||
return '';
|
||||
}
|
||||
|
||||
$data = Contact::getByURL($match[1], false, ['addr', 'nick']);
|
||||
$data = Contact::getByURL($match[1], false, ['addr']);
|
||||
if (empty($data['addr'])) {
|
||||
return $match[0];
|
||||
}
|
||||
|
@ -1517,7 +1517,7 @@ class Transmitter
|
|||
$body = $item['raw-body'] ?? self::removePictures($body);
|
||||
} elseif (($type == 'Article') && empty($data['summary'])) {
|
||||
$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
|
||||
$summary = preg_replace_callback($regexp, ['\Friendica\Protocol\ActivityPub\Transmitter', 'mentionAddrCallback'], $body);
|
||||
$summary = preg_replace_callback($regexp, ['self', 'mentionAddrCallback'], $body);
|
||||
$data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue