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

Missing Whitelist for nofollower, noreferer, noopener #173

Open Daijobou opened 6 years ago

Daijobou commented 6 years ago

I have added a whitelist option to htmlpurifer with and wihout a tld

$config->set('HTML.TargetWhitelist', array('domain1.de','domain2.'));

Reason; you can have multiple domains for a single project or trusted(partner) domains. So here is a option for excluding missing. I have modify multiple files in \library\HTMLPurifier\AttrTransform* and \library\HTMLPurifier\AttrTransform.php itself.

I never make a pull request, but when you have interest in this option, I will try it.