From: Michael Date: Sun, 16 Jul 2023 16:48:24 +0000 (+0000) Subject: Removed unneeded parameter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7e322c21b3ff25f2160bc76808e1412b2891bdae;p=friendica.git Removed unneeded parameter --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 875674544c..f40160c9de 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -226,7 +226,7 @@ class BBCode * @param bool $keep_urls Whether to keep URLs in the resulting plaintext * @return string */ - public static function toPlaintext(string $text, bool $keep_urls = true, bool $strip_tags = false): string + public static function toPlaintext(string $text, bool $keep_urls = true): string { DI::profiler()->startRecording('rendering'); // Remove pictures in advance to avoid unneeded proxy calls @@ -238,9 +238,6 @@ class BBCode $naked_text = HTML::toPlaintext(self::convert($text, false, BBCode::EXTERNAL, true), 0, !$keep_urls); - if ($strip_tags) { - $naked_text = strip_tags($naked_text); - } DI::profiler()->stopRecording(); return $naked_text; } diff --git a/src/Model/Event.php b/src/Model/Event.php index 8221fa82b7..ecf21d3420 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -1012,7 +1012,7 @@ class Event } } - $location['name'] = BBCode::toPlaintext($location['name'], false, true); + $location['name'] = BBCode::toPlaintext($location['name'], false); // Construct the map HTML. if (isset($location['address'])) { diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 0a6881853d..0602df10aa 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -640,13 +640,13 @@ class Profile $istoday = true; } - $title = BBCode::toPlaintext($rr['summary'], false, true); + $title = BBCode::toPlaintext($rr['summary'], false); if (strlen($title) > 35) { $title = substr($title, 0, 32) . '... '; } - $description = BBCode::toPlaintext($rr['desc'], false, true) . '... '; + $description = BBCode::toPlaintext($rr['desc'], false) . '... '; if (!$description) { $description = DI::l10n()->t('[No description]'); } diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php index 48c0d4dfe5..921761ab5c 100644 --- a/src/Module/Notifications/Introductions.php +++ b/src/Module/Notifications/Introductions.php @@ -147,7 +147,7 @@ class Introductions extends BaseNotifications $knowyou = ''; } - $convertedName = BBCode::toPlaintext($Introduction->getName(), false, true); + $convertedName = BBCode::toPlaintext($Introduction->getName(), false); $helptext = $this->t('Shall your connection be bidirectional or not?'); $helptext2 = $this->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $convertedName, $convertedName); diff --git a/src/Navigation/Notifications/Entity/Notify.php b/src/Navigation/Notifications/Entity/Notify.php index d45976c174..ab042bc9f0 100644 --- a/src/Navigation/Notifications/Entity/Notify.php +++ b/src/Navigation/Notifications/Entity/Notify.php @@ -118,7 +118,7 @@ class Notify extends BaseEntity public function updateMsgFromPreamble($epreamble) { $this->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $this->link->__toString()]); - $this->msg_cache = self::formatMessage($this->name_cache, BBCode::toPlaintext($this->msg, false, true)); + $this->msg_cache = self::formatMessage($this->name_cache, BBCode::toPlaintext($this->msg, false)); } /** @@ -134,6 +134,6 @@ class Notify extends BaseEntity */ public static function formatMessage(string $name, string $message): string { - return str_replace('{0}', '' . BBCode::toPlaintext($name, false, true) . '', htmlspecialchars($message)); + return str_replace('{0}', '' . BBCode::toPlaintext($name, false) . '', htmlspecialchars($message)); } } diff --git a/src/Navigation/Notifications/Factory/FormattedNotify.php b/src/Navigation/Notifications/Factory/FormattedNotify.php index 75f6e76769..9b200dea5a 100644 --- a/src/Navigation/Notifications/Factory/FormattedNotify.php +++ b/src/Navigation/Notifications/Factory/FormattedNotify.php @@ -222,7 +222,7 @@ class FormattedNotify extends BaseFactory $this->baseUrl . '/notify/' . $Notify->id, Contact::getAvatarUrlForUrl($Notify->url, $Notify->uid, Proxy::SIZE_MICRO), $Notify->url, - BBCode::toPlaintext($Notify->msg ?? '', false, true), + BBCode::toPlaintext($Notify->msg ?? '', false), DateTimeFormat::local($Notify->date->format(DateTimeFormat::MYSQL), 'r'), Temporal::getRelativeDate($Notify->date->format(DateTimeFormat::MYSQL)), $Notify->seen diff --git a/src/Navigation/Notifications/Factory/Notify.php b/src/Navigation/Notifications/Factory/Notify.php index dd59b3323c..40c77c84de 100644 --- a/src/Navigation/Notifications/Factory/Notify.php +++ b/src/Navigation/Notifications/Factory/Notify.php @@ -68,7 +68,7 @@ class Notify extends BaseFactory implements ICanCreateFromTableRow false, $params['verb'] ?? '', $params['otype'] ?? '', - substr(BBCode::toPlaintext($params['source_name'], false, true), 0, 255), + substr(BBCode::toPlaintext($params['source_name'], false), 0, 255), null, null, $item_id,