fix: enclosure link privacy (#2620)

This commit is contained in:
dag 2022-04-08 23:14:43 +02:00 committed by GitHub
parent cce11964a4
commit dc01891634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -67,13 +67,11 @@ class HtmlFormat extends FormatAbstract {
$entryEnclosures = '<div class="attachments"><p>Attachments:</p>'; $entryEnclosures = '<div class="attachments"><p>Attachments:</p>';
foreach($item->getEnclosures() as $enclosure) { foreach($item->getEnclosures() as $enclosure) {
$template = '<li class="enclosure"><a href="%s" rel="noopener noreferrer nofollow">%s</a></li>';
$url = $this->sanitizeHtml($enclosure); $url = $this->sanitizeHtml($enclosure);
$anchorText = substr($url, strrpos($url, '/') + 1);
$entryEnclosures .= '<li class="enclosure"><a href="' $entryEnclosures .= sprintf($template, $url, $anchorText);
. $url
. '">'
. substr($url, strrpos($url, '/') + 1)
. '</a></li>';
} }
$entryEnclosures .= '</div>'; $entryEnclosures .= '</div>';