ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
HTMLPurifier_URIDefinition Class Reference
+ Inheritance diagram for HTMLPurifier_URIDefinition:
+ Collaboration diagram for HTMLPurifier_URIDefinition:

Public Member Functions

 __construct ()
 
 registerFilter ($filter)
 
 addFilter ($filter, $config)
 
 getDefaultScheme ($config, $context)
 
 filter (&$uri, $config, $context)
 
 postFilter (&$uri, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_Definition
 setup ($config)
 Setup function that aborts if already setup. More...
 

Data Fields

 $type = 'URI'
 
 $base
 HTMLPurifier_URI object of the base specified at URI.Base. More...
 
 $host
 String host to consider "home" base, derived off of $base. More...
 
 $defaultScheme
 Name of default scheme based on URI.DefaultScheme and URI.Base. More...
 
- Data Fields inherited from HTMLPurifier_Definition
 $setup = false
 Has setup() been called yet? bool. More...
 
 $optimized = null
 If true, write out the final definition object to the cache after setup. More...
 
 $type
 What type of definition is it? string. More...
 

Protected Member Functions

 doSetup ($config)
 
 setupFilters ($config)
 
 setupMemberVariables ($config)
 
- Protected Member Functions inherited from HTMLPurifier_Definition
 doSetup ($config)
 Sets up the definition object into the final form, something not done by the constructor. More...
 

Protected Attributes

 $filters = array()
 
 $postFilters = array()
 
 $registeredFilters = array()
 

Detailed Description

Definition at line 3 of file URIDefinition.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addFilter()

HTMLPurifier_URIDefinition::addFilter (   $filter,
  $config 
)

Definition at line 42 of file URIDefinition.php.

References $config, and $r.

Referenced by setupFilters().

43  {
44  $r = $filter->prepare($config);
45  if ($r === false) return; // null is ok, for backwards compat
46  if ($filter->post) {
47  $this->postFilters[$filter->name] = $filter;
48  } else {
49  $this->filters[$filter->name] = $filter;
50  }
51  }
$r
Definition: example_031.php:79
+ Here is the caller graph for this function:

◆ doSetup()

HTMLPurifier_URIDefinition::doSetup (   $config)
protected

Definition at line 53 of file URIDefinition.php.

References $config, setupFilters(), and setupMemberVariables().

54  {
56  $this->setupFilters($config);
57  }
+ Here is the call graph for this function:

◆ filter()

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

Definition at line 92 of file URIDefinition.php.

References $config, and $result.

93  {
94  foreach ($this->filters as $name => $f) {
95  $result = $f->filter($uri, $config, $context);
96  if (!$result) return false;
97  }
98  return true;
99  }
$result

◆ getDefaultScheme()

HTMLPurifier_URIDefinition::getDefaultScheme (   $config,
  $context 
)

Definition at line 87 of file URIDefinition.php.

References $config, and HTMLPurifier_URISchemeRegistry\instance().

88  {
89  return HTMLPurifier_URISchemeRegistry::instance()->getScheme($this->defaultScheme, $config, $context);
90  }
static instance($prototype=null)
Retrieve sole instance of the registry.
+ Here is the call graph for this function:

◆ postFilter()

HTMLPurifier_URIDefinition::postFilter ( $uri,
  $config,
  $context 
)

Definition at line 101 of file URIDefinition.php.

References $config, and $result.

102  {
103  foreach ($this->postFilters as $name => $f) {
104  $result = $f->filter($uri, $config, $context);
105  if (!$result) return false;
106  }
107  return true;
108  }
$result

◆ registerFilter()

HTMLPurifier_URIDefinition::registerFilter (   $filter)

Definition at line 37 of file URIDefinition.php.

Referenced by __construct().

38  {
39  $this->registeredFilters[$filter->name] = $filter;
40  }
+ Here is the caller graph for this function:

◆ setupFilters()

HTMLPurifier_URIDefinition::setupFilters (   $config)
protected

Definition at line 59 of file URIDefinition.php.

References $config, and addFilter().

Referenced by doSetup().

60  {
61  foreach ($this->registeredFilters as $name => $filter) {
62  if ($filter->always_load) {
63  $this->addFilter($filter, $config);
64  } else {
65  $conf = $config->get('URI.' . $name);
66  if ($conf !== false && $conf !== null) {
67  $this->addFilter($filter, $config);
68  }
69  }
70  }
71  unset($this->registeredFilters);
72  }
addFilter($filter, $config)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setupMemberVariables()

HTMLPurifier_URIDefinition::setupMemberVariables (   $config)
protected

Definition at line 74 of file URIDefinition.php.

References $config, $parser, and base().

Referenced by doSetup().

75  {
76  $this->host = $config->get('URI.Host');
77  $base_uri = $config->get('URI.Base');
78  if (!is_null($base_uri)) {
80  $this->base = $parser->parse($base_uri);
81  $this->defaultScheme = $this->base->scheme;
82  if (is_null($this->host)) $this->host = $this->base->host;
83  }
84  if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme');
85  }
base()
Definition: base.php:2
$parser
Definition: BPMN2Parser.php:24
Parses a URI into the components and fragment identifier as specified by RFC 3986.
Definition: URIParser.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $base

HTMLPurifier_URIDefinition::$base

HTMLPurifier_URI object of the base specified at URI.Base.

Definition at line 14 of file URIDefinition.php.

◆ $defaultScheme

HTMLPurifier_URIDefinition::$defaultScheme

Name of default scheme based on URI.DefaultScheme and URI.Base.

Definition at line 24 of file URIDefinition.php.

◆ $filters

HTMLPurifier_URIDefinition::$filters = array()
protected

Definition at line 7 of file URIDefinition.php.

◆ $host

HTMLPurifier_URIDefinition::$host

String host to consider "home" base, derived off of $base.

Definition at line 19 of file URIDefinition.php.

◆ $postFilters

HTMLPurifier_URIDefinition::$postFilters = array()
protected

Definition at line 8 of file URIDefinition.php.

◆ $registeredFilters

HTMLPurifier_URIDefinition::$registeredFilters = array()
protected

Definition at line 9 of file URIDefinition.php.

◆ $type

HTMLPurifier_URIDefinition::$type = 'URI'

Definition at line 6 of file URIDefinition.php.


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