Verlinkung & Backlinks: systemseitige rel-Auszeichnung (Decision-Update 11.06.)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5a8da0c1f4
commit
25ea91d85b
8 changed files with 239 additions and 3 deletions
|
|
@ -17,6 +17,8 @@ class PressReleaseHtmlSanitizer
|
|||
{
|
||||
private const string PURIFIER_PROFILE = 'press_release';
|
||||
|
||||
public function __construct(private readonly PressReleaseLinkPolicy $linkPolicy) {}
|
||||
|
||||
/**
|
||||
* Sanitize HTML before persisting to the database.
|
||||
*/
|
||||
|
|
@ -44,6 +46,10 @@ class PressReleaseHtmlSanitizer
|
|||
|
||||
/**
|
||||
* Produce a display-ready, safe HtmlString.
|
||||
*
|
||||
* Die Link-Policy (rel systemseitig: extern sponsored/nofollow,
|
||||
* portalintern follow) greift hier beim Rendern — so wirken
|
||||
* Regel-Änderungen rückwirkend auf alle gespeicherten Inhalte.
|
||||
*/
|
||||
public function render(?string $text): HtmlString
|
||||
{
|
||||
|
|
@ -52,7 +58,7 @@ class PressReleaseHtmlSanitizer
|
|||
}
|
||||
|
||||
if ($this->isHtml($text)) {
|
||||
return new HtmlString($this->clean($text));
|
||||
return new HtmlString($this->linkPolicy->apply($this->clean($text)));
|
||||
}
|
||||
|
||||
$escaped = e($text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue