3 // It's not clear to me whether or not Punycode means that hostnames
4 // do not have canonical forms anymore. As far as I can tell, it's
5 // not a problem (punycoding should be identity when no Unicode
6 // points are involved), but I'm not 100% sure
7 class HTMLPurifier_URIFilter_HostBlacklist
extends HTMLPurifier_URIFilter
12 public $name = 'HostBlacklist';
17 protected $blacklist = array();
20 * @param HTMLPurifier_Config $config
23 public function prepare($config)
25 $this->blacklist
= $config->get('URI.HostBlacklist');
30 * @param HTMLPurifier_URI $uri
31 * @param HTMLPurifier_Config $config
32 * @param HTMLPurifier_Context $context
35 public function filter(&$uri, $config, $context)
37 foreach ($this->blacklist
as $blacklisted_host_fragment) {
38 if (strpos($uri->host
, $blacklisted_host_fragment) !== false) {