Improve the code
This commit is contained in:
parent
bf76b43330
commit
304b52ec0f
|
@ -1346,7 +1346,7 @@ class Transmitter
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = Contact::getByURL($match[1], false, ['addr', 'nick']);
|
$data = Contact::getByURL($match[1], false, ['addr']);
|
||||||
if (empty($data['addr'])) {
|
if (empty($data['addr'])) {
|
||||||
return $match[0];
|
return $match[0];
|
||||||
}
|
}
|
||||||
|
@ -1517,7 +1517,7 @@ class Transmitter
|
||||||
$body = $item['raw-body'] ?? self::removePictures($body);
|
$body = $item['raw-body'] ?? self::removePictures($body);
|
||||||
} elseif (($type == 'Article') && empty($data['summary'])) {
|
} elseif (($type == 'Article') && empty($data['summary'])) {
|
||||||
$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
|
$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));
|
$data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user