* @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
$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;
}
}
}
- $location['name'] = BBCode::toPlaintext($location['name'], false, true);
+ $location['name'] = BBCode::toPlaintext($location['name'], false);
// Construct the map HTML.
if (isset($location['address'])) {
$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]');
}
$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);
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));
}
/**
*/
public static function formatMessage(string $name, string $message): string
{
- return str_replace('{0}', '<span class="contactname">' . BBCode::toPlaintext($name, false, true) . '</span>', htmlspecialchars($message));
+ return str_replace('{0}', '<span class="contactname">' . BBCode::toPlaintext($name, false) . '</span>', htmlspecialchars($message));
}
}
$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
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,