ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.07k stars 327 forks source link

AllowedRel inserts noopener noreferrer when onlynofollow #215

Closed charlymz closed 5 years ago

charlymz commented 5 years ago

Hi, i had enabled the use of rel="nofollow" but it inserts noopener and noreferrer sample use $text = 'test'; $config = \HTMLPurifier_Config::createDefault(); $config->set('Attr.AllowedFrameTargets', array('_blank')); $config->set('Attr.AllowedRel', array('nofollow')); $purifier = new \HTMLPurifier($config); $text = $purifier->purify($text);

returns test

thanks

charlymz commented 5 years ago

found how to do it with $config->set('HTML.TargetNoopener', false); $config->set('HTML.TargetNoreferrer', false);