mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Use centralized functions for tag string handling
This commit is contained in:
parent
9e738253e7
commit
d2702dfe9c
6 changed files with 46 additions and 44 deletions
|
@ -97,20 +97,13 @@ class Relay
|
|||
|
||||
$body = ActivityPub\Processor::normalizeMentionLinks($body);
|
||||
|
||||
$denyTags = [];
|
||||
|
||||
if ($scope == self::SCOPE_TAGS) {
|
||||
$tagList = self::getSubscribedTags();
|
||||
} else {
|
||||
$tagList = [];
|
||||
}
|
||||
|
||||
$deny_tags = $config->get('system', 'relay_deny_tags');
|
||||
$tagitems = explode(',', mb_strtolower($deny_tags));
|
||||
foreach ($tagitems as $tag) {
|
||||
$tag = trim($tag, '# ');
|
||||
$denyTags[] = $tag;
|
||||
}
|
||||
$denyTags = Strings::getTagArrayByString($config->get('system', 'relay_deny_tags'));
|
||||
|
||||
if (!empty($tagList) || !empty($denyTags)) {
|
||||
$content = mb_strtolower(BBCode::toPlaintext($body, false));
|
||||
|
@ -168,10 +161,7 @@ class Relay
|
|||
*/
|
||||
public static function getSubscribedTags(): array
|
||||
{
|
||||
$tags = [];
|
||||
foreach (explode(',', mb_strtolower(DI::config()->get('system', 'relay_server_tags'))) as $tag) {
|
||||
$tags[] = trim($tag, '# ');
|
||||
}
|
||||
$tags = Strings::getTagArrayByString(DI::config()->get('system', 'relay_server_tags'));
|
||||
|
||||
if (DI::config()->get('system', 'relay_user_tags')) {
|
||||
$tags = array_merge($tags, Search::getUserTags());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue