PATH:
home
/
letacommog
/
crmleta
/
libraries
/
htmlpurifier
/
library
/
HTMLPurifier
<?php class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition { public $type = 'URI'; protected $filters = array(); protected $postFilters = array(); protected $registeredFilters = array(); /** * HTMLPurifier_URI object of the base specified at %URI.Base */ public $base; /** * String host to consider "home" base, derived off of $base */ public $host; /** * Name of default scheme based on %URI.DefaultScheme and %URI.Base */ public $defaultScheme; public function __construct() { $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); $this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute()); $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); } public function registerFilter($filter) { $this->registeredFilters[$filter->name] = $filter; } public function addFilter($filter, $config) { $r = $filter->prepare($config); if ($r === false) return; // null is ok, for backwards compat if ($filter->post) { $this->postFilters[$filter->name] = $filter; } else { $this->filters[$filter->name] = $filter; } } protected function doSetup($config) { $this->setupMemberVariables($config); $this->setupFilters($config); } protected function setupFilters($config) { foreach ($this->registeredFilters as $name => $filter) { $conf = $config->get('URI', $name); if ($conf !== false && $conf !== null) { $this->addFilter($filter, $config); } } unset($this->registeredFilters); } protected function setupMemberVariables($config) { $this->host = $config->get('URI', 'Host'); $base_uri = $config->get('URI', 'Base'); if (!is_null($base_uri)) { $parser = new HTMLPurifier_URIParser(); $this->base = $parser->parse($base_uri); $this->defaultScheme = $this->base->scheme; if (is_null($this->host)) $this->host = $this->base->host; } if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI', 'DefaultScheme'); } public function filter(&$uri, $config, $context) { foreach ($this->filters as $name => $f) { $result = $f->filter($uri, $config, $context); if (!$result) return false; } return true; } public function postFilter(&$uri, $config, $context) { foreach ($this->postFilters as $name => $f) { $result = $f->filter($uri, $config, $context); if (!$result) return false; } return true; } } // vim: et sw=4 sts=4
[+]
..
[-] PropertyList.php
[edit]
[+]
Injector
[-] ErrorStruct.php
[edit]
[-] Bootstrap.php
[edit]
[-] Printer.php
[edit]
[-] VarParserException.php
[edit]
[+]
Language
[-] ConfigSchema.php
[edit]
[-] Doctype.php
[edit]
[+]
Filter
[-] URIDefinition.php
[edit]
[-] URIScheme.php
[edit]
[+]
Lexer
[-] Context.php
[edit]
[+]
URIFilter
[+]
URIScheme
[-] VarParser.php
[edit]
[-] ElementDef.php
[edit]
[+]
DefinitionCache
[-] URISchemeRegistry.php
[edit]
[-] EntityParser.php
[edit]
[-] AttrValidator.php
[edit]
[-] URIFilter.php
[edit]
[+]
EntityLookup
[-] ContentSets.php
[edit]
[+]
VarParser
[-] UnitConverter.php
[edit]
[-] ErrorCollector.php
[edit]
[-] EntityLookup.php
[edit]
[-] Config.php
[edit]
[-] URI.php
[edit]
[-] DoctypeRegistry.php
[edit]
[+]
Token
[-] Strategy.php
[edit]
[+]
HTMLModule
[+]
AttrTransform
[-] Language.php
[edit]
[+]
TagTransform
[-] HTMLDefinition.php
[edit]
[-] LanguageFactory.php
[edit]
[+]
AttrDef
[+]
Strategy
[-] PropertyListIterator.php
[edit]
[-] Encoder.php
[edit]
[-] ChildDef.php
[edit]
[-] AttrCollections.php
[edit]
[-] Lexer.php
[edit]
[-] Exception.php
[edit]
[+]
Printer
[-] AttrDef.php
[edit]
[-] TokenFactory.php
[edit]
[-] Generator.php
[edit]
[-] DefinitionCache.php
[edit]
[-] TagTransform.php
[edit]
[-] StringHashParser.php
[edit]
[-] AttrTypes.php
[edit]
[-] StringHash.php
[edit]
[+]
ConfigSchema
[-] HTMLModuleManager.php
[edit]
[-] Token.php
[edit]
[-] URIParser.php
[edit]
[-] CSSDefinition.php
[edit]
[+]
ChildDef
[-] Length.php
[edit]
[-] PercentEncoder.php
[edit]
[-] Injector.php
[edit]
[-] AttrTransform.php
[edit]
[-] IDAccumulator.php
[edit]
[-] DefinitionCacheFactory.php
[edit]
[-] Definition.php
[edit]
[-] HTMLModule.php
[edit]
[-] Filter.php
[edit]