Attr.AllowedRel not working

22 views
Skip to first unread message

No One

unread,
May 22, 2022, 1:06:10 AM5/22/22
to htmlpurifier
Hi, I have some code like this:

require_once __DIR__ . '/htmlpurifier/library/HTMLPurifier.auto.php';



$HTMLPurifierConfig = HTMLPurifier_Config::createDefault();

$HTMLPurifierConfig->set('HTML.Doctype', 'XHTML 1.1');

$HTMLPurifierConfig->set("Attr.AllowedRel", array('ugc noopener noreferrer' => true));
$purifier = new HTMLPurifier($HTMLPurifierConfig);

// Then I call:
echo $purifier->purify('<a href="https://htmlpurifier.org">HTML Purifier');
// And I get:
<a href="https://htmlpurifier.org">HTML Purifier</a>
// without the rel="ugc noopener noreferrer". Why is this?
Reply all
Reply to author
Forward
0 new messages