mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-12 01:48:48 +00:00
fix: enclosure link privacy (#2620)
This commit is contained in:
parent
cce11964a4
commit
dc01891634
@ -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>';
|
||||||
|
Loading…
Reference in New Issue
Block a user