ILIAS  release_4-4 Revision
HTMLPurifier_URIFilter_DisableExternal Class Reference
+ Inheritance diagram for HTMLPurifier_URIFilter_DisableExternal:
+ Collaboration diagram for HTMLPurifier_URIFilter_DisableExternal:

Public Member Functions

 prepare ($config)
 
 filter (&$uri, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_URIFilter
 prepare ($config)
 Performs initialization for the filter. More...
 
 filter (&$uri, $config, $context)
 Filter a URI object. More...
 

Data Fields

 $name = 'DisableExternal'
 
- Data Fields inherited from HTMLPurifier_URIFilter
 $name
 Unique identifier of filter. More...
 
 $post = false
 True if this filter should be run after scheme validation. More...
 
 $always_load = false
 True if this filter should always be loaded (this permits a filter to be named Foo without the corresponding URI.Foo directive existing.) More...
 

Protected Attributes

 $ourHostParts = false
 

Detailed Description

Definition at line 3 of file DisableExternal.php.

Member Function Documentation

◆ filter()

HTMLPurifier_URIFilter_DisableExternal::filter ( $uri,
  $config,
  $context 
)

Definition at line 11 of file DisableExternal.php.

11  {
12  if (is_null($uri->host)) return true;
13  if ($this->ourHostParts === false) return false;
14  $host_parts = array_reverse(explode('.', $uri->host));
15  foreach ($this->ourHostParts as $i => $x) {
16  if (!isset($host_parts[$i])) return false;
17  if ($host_parts[$i] != $this->ourHostParts[$i]) return false;
18  }
19  return true;
20  }

◆ prepare()

HTMLPurifier_URIFilter_DisableExternal::prepare (   $config)

Definition at line 7 of file DisableExternal.php.

7  {
8  $our_host = $config->getDefinition('URI')->host;
9  if ($our_host !== null) $this->ourHostParts = array_reverse(explode('.', $our_host));
10  }

Field Documentation

◆ $name

HTMLPurifier_URIFilter_DisableExternal::$name = 'DisableExternal'

Definition at line 5 of file DisableExternal.php.

◆ $ourHostParts

HTMLPurifier_URIFilter_DisableExternal::$ourHostParts = false
protected

Definition at line 6 of file DisableExternal.php.


The documentation for this class was generated from the following file: