1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Add target="_blank" and rel="nofollow" to all formatted links

closes #247
This commit is contained in:
Toby Zerner
2015-08-31 13:36:54 +09:30
parent 283abb88c2
commit bcc16a3329

View File

@@ -42,6 +42,15 @@ class Formatter
event(new FormatterConfigurator($configurator));
$dom = $configurator->tags['URL']->template->asDOM();
foreach ($dom->getElementsByTagName('a') as $a) {
$a->setAttribute('target', '_blank');
$a->setAttribute('rel', 'nofollow');
}
$dom->saveChanges();
return $configurator;
}