3 class HTMLPurifier_URIFilter_DisableExternal
extends HTMLPurifier_URIFilter
8 public $name = 'DisableExternal';
13 protected $ourHostParts = false;
16 * @param HTMLPurifier_Config $config
19 public function prepare($config)
21 $our_host = $config->getDefinition('URI')->host
;
22 if ($our_host !== null) {
23 $this->ourHostParts
= array_reverse(explode('.', $our_host));
28 * @param HTMLPurifier_URI $uri Reference
29 * @param HTMLPurifier_Config $config
30 * @param HTMLPurifier_Context $context
33 public function filter(&$uri, $config, $context)
35 if (is_null($uri->host
)) {
38 if ($this->ourHostParts
=== false) {
41 $host_parts = array_reverse(explode('.', $uri->host
));
42 foreach ($this->ourHostParts
as $i => $x) {
43 if (!isset($host_parts[$i])) {
46 if ($host_parts[$i] != $this->ourHostParts
[$i]) {