diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index dcec024cf0..f5cf2c6eca 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -51,7 +51,7 @@ class HTML private static function tagToBBCodeSub(DOMDocument $doc, string $tag, array $attributes, string $startbb, string $endbb, bool $ignoreChildren = false): bool { $savestart = str_replace('$', '\x01', $startbb); - $replace = false; + $replace = false; $xpath = new DOMXPath($doc); @@ -93,7 +93,7 @@ class HTML if ($replace) { $StartCode = $doc->createTextNode($startbb); - $EndCode = $doc->createTextNode($endbb); + $EndCode = $doc->createTextNode($endbb); $node->parentNode->insertBefore($StartCode, $node); @@ -143,7 +143,7 @@ class HTML $eventDispatcher = DI::eventDispatcher(); - $message = Strings::performWithEscapedBlocks($message, '#
#iUs', function ($message) use($eventDispatcher) { + $message = Strings::performWithEscapedBlocks($message, '#
#iUs', function ($message) use ($eventDispatcher) { $message = str_replace( [ "
",
@@ -160,7 +160,7 @@ class HTML
$message = preg_replace('=<(\w+):(.+?)>=', ']*) src=\"(?!http|https)([^\"]*)\"/";
$replace = "
DI::l10n()->t('Loading more entries...'),
- 'end' => DI::l10n()->t('The end')
+ 'end' => DI::l10n()->t('The end')
]);
}
@@ -807,9 +807,9 @@ class HTML
$contact["addr"] = $contact["url"];
}
- $url = $contact['url'];
+ $url = $contact['url'];
$sparkle = '';
- $redir = false;
+ $redir = false;
if ($redirect) {
$url = Contact::magicLinkByContact($contact);
@@ -824,14 +824,14 @@ class HTML
}
return Renderer::replaceMacros(Renderer::getMarkupTemplate($textmode ? 'micropro_txt.tpl' : 'micropro_img.tpl'), [
- '$click' => $contact['click'] ?? '',
- '$class' => $class,
- '$url' => $url,
- '$photo' => Contact::getThumb($contact),
- '$name' => $contact['name'],
- 'title' => $contact['name'] . ' [' . $contact['addr'] . ']',
+ '$click' => $contact['click'] ?? '',
+ '$class' => $class,
+ '$url' => $url,
+ '$photo' => Contact::getThumb($contact),
+ '$name' => $contact['name'],
+ 'title' => $contact['name'] . ' [' . $contact['addr'] . ']',
'$parkle' => $sparkle,
- '$redir' => $redir
+ '$redir' => $redir
]);
}
@@ -893,7 +893,7 @@ class HTML
public static function applyContentFilter(string $html, array $reasons): string
{
if (count($reasons)) {
- $tpl = Renderer::getMarkupTemplate('wall/content_filter.tpl');
+ $tpl = Renderer::getMarkupTemplate('wall/content_filter.tpl');
$html = Renderer::replaceMacros($tpl, [
'$reasons' => $reasons,
'$rnd' => Strings::getRandomHex(8),
@@ -951,8 +951,8 @@ class HTML
$config->set('Attr.AllowedRel', [
'noreferrer' => true,
- 'noopener' => true,
- 'tag' => true,
+ 'noopener' => true,
+ 'tag' => true,
]);
$config->set('Attr.AllowedFrameTargets', [
'_blank' => true,
@@ -1046,7 +1046,7 @@ class HTML
// This expression looks for a meta tag with the http-equiv attribute set to "content-type" ignoring case
// whose content attribute contains a "charset" string and returns its value
$expression = "string(//meta[@http-equiv][translate(@http-equiv, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'content-type'][contains(translate(@content, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'charset')]/@content)";
- $mediaType = MediaType::fromContentType($xpath->evaluate($expression));
+ $mediaType = MediaType::fromContentType($xpath->evaluate($expression));
if (isset($mediaType->parameters['charset'])) {
return strtolower($mediaType->parameters['charset']);
}