Set HTML Purifier to add target=blank on external links, this should also add rel=nofollow and rel=noopener, closing #4

This commit is contained in:
Jonny Barnes 2017-03-19 19:06:48 +00:00
parent 608d71dc67
commit a377eb797d

View file

@ -284,6 +284,7 @@ class NotesController extends Controller
{
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache.SerializerPath', storage_path() . '/HTMLPurifier');
$config->set('HTML.TargetBlank', true);
$purifier = new HTMLPurifier($config);
return $purifier->purify($html);