From bd64a8346d5655713db8da11b21258a02b969c19 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 5 Mar 2008 03:51:09 +0000 Subject: [PATCH] Reorganize VarParser; there may be multiple implementations. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1602 48356398-32a2-884e-a903-53898d9a118a --- NEWS | 2 +- library/HTMLPurifier.includes.php | 1 + library/HTMLPurifier/Config.php | 2 +- library/HTMLPurifier/ConfigSchema.php | 2 +- .../HTMLPurifier/ConfigSchema/Interchange.php | 17 --- .../ConfigSchema/Validator/ParseType.php | 2 +- library/HTMLPurifier/ConfigSchema/schema.ser | 2 +- library/HTMLPurifier/VarParser.php | 107 ++---------------- library/HTMLPurifier/VarParser/Flexible.php | 103 +++++++++++++++++ .../FlexibleTest.php} | 26 +---- tests/HTMLPurifier/VarParserHarness.php | 31 +++++ 11 files changed, 152 insertions(+), 143 deletions(-) create mode 100644 library/HTMLPurifier/VarParser/Flexible.php rename tests/HTMLPurifier/{VarParserTest.php => VarParser/FlexibleTest.php} (77%) create mode 100644 tests/HTMLPurifier/VarParserHarness.php diff --git a/NEWS b/NEWS index 7a1a06e9..524bbd4d 100644 --- a/NEWS +++ b/NEWS @@ -22,7 +22,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier maintenance/generate-schema-cache.php generates the schema.ser file, which is now instantiated. Support for userland schema changes coming soon! ! Extra utility classes for testing and non-library operations can - be found in extras/. Specifically, these are FSTools and ConfigSchema. + be found in extras/. Specifically, these are FSTools and ConfigDoc. You may find a use for these in your own project, but right now they are highly experimental and volatile. ! Integration with PHPT allows for automated smoketests diff --git a/library/HTMLPurifier.includes.php b/library/HTMLPurifier.includes.php index 87adc0ad..b8bf41f5 100644 --- a/library/HTMLPurifier.includes.php +++ b/library/HTMLPurifier.includes.php @@ -200,3 +200,4 @@ require 'HTMLPurifier/URIScheme/https.php'; require 'HTMLPurifier/URIScheme/mailto.php'; require 'HTMLPurifier/URIScheme/news.php'; require 'HTMLPurifier/URIScheme/nntp.php'; +require 'HTMLPurifier/VarParser/Flexible.php'; diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php index c7424da4..49898263 100644 --- a/library/HTMLPurifier/Config.php +++ b/library/HTMLPurifier/Config.php @@ -75,7 +75,7 @@ class HTMLPurifier_Config public function __construct(&$definition) { $this->conf = $definition->defaults; // set up, copy in defaults $this->def = $definition; // keep a copy around for checking - $this->parser = new HTMLPurifier_VarParser(); + $this->parser = new HTMLPurifier_VarParser_Flexible(); } /** diff --git a/library/HTMLPurifier/ConfigSchema.php b/library/HTMLPurifier/ConfigSchema.php index 0c219e6b..1f30d93e 100644 --- a/library/HTMLPurifier/ConfigSchema.php +++ b/library/HTMLPurifier/ConfigSchema.php @@ -51,7 +51,7 @@ class HTMLPurifier_ConfigSchema { ); public function __construct() { - $this->parser = new HTMLPurifier_VarParser(); + $this->parser = new HTMLPurifier_VarParser_Flexible(); } /** diff --git a/library/HTMLPurifier/ConfigSchema/Interchange.php b/library/HTMLPurifier/ConfigSchema/Interchange.php index 57b0c9cd..9bf45871 100644 --- a/library/HTMLPurifier/ConfigSchema/Interchange.php +++ b/library/HTMLPurifier/ConfigSchema/Interchange.php @@ -8,23 +8,6 @@ class HTMLPurifier_ConfigSchema_Interchange { - /** - * Hash table of allowed types. - */ - public $types = array( - 'string' => 'String', - 'istring' => 'Case-insensitive string', - 'text' => 'Text', - 'itext' => 'Case-insensitive text', - 'int' => 'Integer', - 'float' => 'Float', - 'bool' => 'Boolean', - 'lookup' => 'Lookup array', - 'list' => 'Array list', - 'hash' => 'Associative array', - 'mixed' => 'Mixed' - ); - /** * Array of Namespace ID => array(namespace info) */ diff --git a/library/HTMLPurifier/ConfigSchema/Validator/ParseType.php b/library/HTMLPurifier/ConfigSchema/Validator/ParseType.php index dc0a4dab..f6bf58d7 100644 --- a/library/HTMLPurifier/ConfigSchema/Validator/ParseType.php +++ b/library/HTMLPurifier/ConfigSchema/Validator/ParseType.php @@ -8,7 +8,7 @@ class HTMLPurifier_ConfigSchema_Validator_ParseType extends HTMLPurifier_ConfigS public function validate(&$arr, $interchange) { $r = explode('/', $arr['TYPE'], 2); - if (!isset($interchange->types[$r[0]])) { + if (!isset(HTMLPurifier_VarParser::$types[$r[0]])) { $this->error('Invalid type ' . $r[0] . ' for configuration directive ' . $arr['ID']); } $arr['_TYPE'] = $r[0]; diff --git a/library/HTMLPurifier/ConfigSchema/schema.ser b/library/HTMLPurifier/ConfigSchema/schema.ser index 1eaeeea9..e027f34d 100644 --- a/library/HTMLPurifier/ConfigSchema/schema.ser +++ b/library/HTMLPurifier/ConfigSchema/schema.ser @@ -1 +1 @@ -O:25:"HTMLPurifier_ConfigSchema":5:{s:8:"defaults";a:11:{s:4:"Attr";a:11:{s:19:"AllowedFrameTargets";a:0:{}s:10:"AllowedRel";a:0:{}s:10:"AllowedRev";a:0:{}s:19:"DefaultInvalidImage";s:0:"";s:22:"DefaultInvalidImageAlt";s:13:"Invalid image";s:14:"DefaultTextDir";s:3:"ltr";s:8:"EnableID";b:0;s:11:"IDBlacklist";a:0:{}s:17:"IDBlacklistRegexp";N;s:8:"IDPrefix";s:0:"";s:13:"IDPrefixLocal";s:0:"";}s:10:"AutoFormat";a:4:{s:13:"AutoParagraph";b:0;s:6:"Custom";a:0:{}s:7:"Linkify";b:0;s:15:"PurifierLinkify";b:0;}s:15:"AutoFormatParam";a:1:{s:21:"PurifierLinkifyDocURL";s:3:"#%s";}s:3:"CSS";a:4:{s:14:"AllowImportant";b:0;s:11:"AllowTricky";b:0;s:13:"DefinitionRev";i:1;s:11:"Proprietary";b:0;}s:5:"Cache";a:2:{s:14:"DefinitionImpl";s:10:"Serializer";s:14:"SerializerPath";N;}s:4:"Core";a:15:{s:17:"AggressivelyFixLt";b:0;s:13:"CollectErrors";b:0;s:13:"ColorKeywords";a:17:{s:6:"maroon";s:7:"#800000";s:3:"red";s:7:"#FF0000";s:6:"orange";s:7:"#FFA500";s:6:"yellow";s:7:"#FFFF00";s:5:"olive";s:7:"#808000";s:6:"purple";s:7:"#800080";s:7:"fuchsia";s:7:"#FF00FF";s:5:"white";s:7:"#FFFFFF";s:4:"lime";s:7:"#00FF00";s:5:"green";s:7:"#008000";s:4:"navy";s:7:"#000080";s:4:"blue";s:7:"#0000FF";s:4:"aqua";s:7:"#00FFFF";s:4:"teal";s:7:"#008080";s:5:"black";s:7:"#000000";s:6:"silver";s:7:"#C0C0C0";s:4:"gray";s:7:"#808080";}s:25:"ConvertDocumentToFragment";b:1;s:31:"DirectLexLineNumberSyncInterval";i:0;s:8:"Encoding";s:5:"utf-8";s:21:"EscapeInvalidChildren";b:0;s:17:"EscapeInvalidTags";b:0;s:24:"EscapeNonASCIICharacters";b:0;s:14:"HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:8:"Language";s:2:"en";s:9:"LexerImpl";N;s:19:"MaintainLineNumbers";N;s:16:"RemoveInvalidImg";b:1;s:20:"RemoveScriptContents";N;}s:6:"Filter";a:2:{s:26:"ExtractStyleBlocksEscaping";b:1;s:23:"ExtractStyleBlocksScope";N;}s:4:"HTML";a:18:{s:7:"Allowed";N;s:17:"AllowedAttributes";N;s:15:"AllowedElements";N;s:14:"AllowedModules";N;s:12:"BlockWrapper";s:1:"p";s:11:"CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:13:"CustomDoctype";N;s:12:"DefinitionID";N;s:13:"DefinitionRev";i:1;s:7:"Doctype";s:0:"";s:6:"Parent";s:3:"div";s:11:"Proprietary";b:0;s:6:"Strict";b:0;s:7:"TidyAdd";a:0:{}s:9:"TidyLevel";s:6:"medium";s:10:"TidyRemove";a:0:{}s:7:"Trusted";b:0;s:5:"XHTML";b:1;}s:6:"Output";a:3:{s:21:"CommentScriptContents";b:1;s:7:"Newline";N;s:10:"TidyFormat";b:0;}s:4:"Test";a:1:{s:12:"ForceNoIconv";b:0;}s:3:"URI";a:14:{s:14:"AllowedSchemes";a:6:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;}s:4:"Base";N;s:13:"DefaultScheme";s:4:"http";s:12:"DefinitionID";N;s:13:"DefinitionRev";i:1;s:7:"Disable";b:0;s:15:"DisableExternal";b:0;s:24:"DisableExternalResources";b:0;s:16:"DisableResources";b:0;s:4:"Host";N;s:13:"HostBlacklist";a:0:{}s:12:"MakeAbsolute";b:0;s:5:"Munge";N;s:22:"OverrideAllowedSchemes";b:1;}}s:4:"info";a:11:{s:4:"Attr";a:12:{s:19:"AllowedFrameTargets";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"AllowedRel";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"AllowedRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:19:"DefaultInvalidImage";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:22:"DefaultInvalidImageAlt";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"DefaultTextDir";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"EnableID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:17:"HTML.EnableAttrID";}}s:11:"IDBlacklist";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"IDBlacklistRegexp";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"IDPrefix";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"IDPrefixLocal";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"DisableURI";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:3:"URI";s:4:"name";s:7:"Disable";}}s:10:"AutoFormat";a:4:{s:13:"AutoParagraph";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Custom";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Linkify";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:15:"PurifierLinkify";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:15:"AutoFormatParam";a:1:{s:21:"PurifierLinkifyDocURL";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:3:"CSS";a:4:{s:14:"AllowImportant";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"AllowTricky";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"Proprietary";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:5:"Cache";a:2:{s:14:"DefinitionImpl";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:20:"Core.DefinitionCache";}}s:14:"SerializerPath";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:4:"Core";a:20:{s:15:"DefinitionCache";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:5:"Cache";s:4:"name";s:14:"DefinitionImpl";}s:17:"AggressivelyFixLt";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"CollectErrors";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"ColorKeywords";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"hash";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:25:"ConvertDocumentToFragment";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:24:"Core.AcceptFullDocuments";}}s:19:"AcceptFullDocuments";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"Core";s:4:"name";s:25:"ConvertDocumentToFragment";}s:31:"DirectLexLineNumberSyncInterval";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"Encoding";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:7:"istring";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:21:"EscapeInvalidChildren";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"EscapeInvalidTags";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:24:"EscapeNonASCIICharacters";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"HiddenElements";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"Language";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:9:"LexerImpl";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:5:"mixed";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:19:"MaintainLineNumbers";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:16:"RemoveInvalidImg";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:20:"RemoveScriptContents";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"XHTML";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"HTML";s:4:"name";s:5:"XHTML";}s:21:"CommentScriptContents";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:6:"Output";s:4:"name";s:21:"CommentScriptContents";}s:10:"TidyFormat";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:6:"Output";s:4:"name";s:10:"TidyFormat";}}s:6:"Filter";a:2:{s:26:"ExtractStyleBlocksEscaping";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:23:"ExtractStyleBlocksScope";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:4:"HTML";a:19:{s:12:"EnableAttrID";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"Attr";s:4:"name";s:8:"EnableID";}s:7:"Allowed";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:5:"itext";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"AllowedAttributes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:15:"AllowedElements";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"AllowedModules";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"BlockWrapper";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"CoreModules";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"CustomDoctype";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"DefinitionID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Doctype";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:6:{s:0:"";b:1;s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Parent";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"Proprietary";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Strict";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"TidyAdd";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:9:"TidyLevel";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"TidyRemove";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Trusted";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"XHTML";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:10:"Core.XHTML";}}}s:6:"Output";a:3:{s:21:"CommentScriptContents";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:26:"Core.CommentScriptContents";}}s:7:"Newline";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"TidyFormat";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:15:"Core.TidyFormat";}}}s:4:"Test";a:1:{s:12:"ForceNoIconv";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:3:"URI";a:14:{s:14:"AllowedSchemes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:4:"Base";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefaultScheme";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"DefinitionID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Disable";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:15:"Attr.DisableURI";}}s:15:"DisableExternal";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:24:"DisableExternalResources";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:16:"DisableResources";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:4:"Host";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"HostBlacklist";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"MakeAbsolute";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"Munge";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:22:"OverrideAllowedSchemes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}}s:14:"info_namespace";a:11:{s:4:"Attr";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:40:"Features regarding attribute validation.";}s:10:"AutoFormat";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:97:"Configuration for activating auto-formatting functionality (also known as Injectors)";}s:15:"AutoFormatParam";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:59:"Configuration for customizing auto-formatting functionality";}s:3:"CSS";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:36:"Configuration regarding allowed CSS.";}s:5:"Cache";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:57:"Configuration for DefinitionCache and related subclasses.";}s:4:"Core";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:40:"Core features that are always available.";}s:6:"Filter";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:25:"Configuration for filters";}s:4:"HTML";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:37:"Configuration regarding allowed HTML.";}s:6:"Output";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:52:"Configuration relating to the generation of (X)HTML.";}s:4:"Test";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:51:"Developer testing configuration for our unit tests.";}s:3:"URI";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:48:"Features regarding Uniform Resource Identifiers.";}}s:9:"*parser";O:22:"HTMLPurifier_VarParser":1:{s:5:"types";a:11:{s:6:"string";b:1;s:7:"istring";b:1;s:4:"text";b:1;s:5:"itext";b:1;s:3:"int";b:1;s:5:"float";b:1;s:4:"bool";b:1;s:6:"lookup";b:1;s:4:"list";b:1;s:4:"hash";b:1;s:5:"mixed";b:1;}}s:5:"types";a:11:{s:6:"string";s:6:"String";s:7:"istring";s:23:"Case-insensitive string";s:4:"text";s:4:"Text";s:5:"itext";s:21:"Case-insensitive text";s:3:"int";s:7:"Integer";s:5:"float";s:5:"Float";s:4:"bool";s:7:"Boolean";s:6:"lookup";s:12:"Lookup array";s:4:"list";s:10:"Array list";s:4:"hash";s:17:"Associative array";s:5:"mixed";s:5:"Mixed";}} \ No newline at end of file +O:25:"HTMLPurifier_ConfigSchema":5:{s:8:"defaults";a:11:{s:4:"Attr";a:11:{s:19:"AllowedFrameTargets";a:0:{}s:10:"AllowedRel";a:0:{}s:10:"AllowedRev";a:0:{}s:19:"DefaultInvalidImage";s:0:"";s:22:"DefaultInvalidImageAlt";s:13:"Invalid image";s:14:"DefaultTextDir";s:3:"ltr";s:8:"EnableID";b:0;s:11:"IDBlacklist";a:0:{}s:17:"IDBlacklistRegexp";N;s:8:"IDPrefix";s:0:"";s:13:"IDPrefixLocal";s:0:"";}s:10:"AutoFormat";a:4:{s:13:"AutoParagraph";b:0;s:6:"Custom";a:0:{}s:7:"Linkify";b:0;s:15:"PurifierLinkify";b:0;}s:15:"AutoFormatParam";a:1:{s:21:"PurifierLinkifyDocURL";s:3:"#%s";}s:3:"CSS";a:4:{s:14:"AllowImportant";b:0;s:11:"AllowTricky";b:0;s:13:"DefinitionRev";i:1;s:11:"Proprietary";b:0;}s:5:"Cache";a:2:{s:14:"DefinitionImpl";s:10:"Serializer";s:14:"SerializerPath";N;}s:4:"Core";a:15:{s:17:"AggressivelyFixLt";b:0;s:13:"CollectErrors";b:0;s:13:"ColorKeywords";a:17:{s:6:"maroon";s:7:"#800000";s:3:"red";s:7:"#FF0000";s:6:"orange";s:7:"#FFA500";s:6:"yellow";s:7:"#FFFF00";s:5:"olive";s:7:"#808000";s:6:"purple";s:7:"#800080";s:7:"fuchsia";s:7:"#FF00FF";s:5:"white";s:7:"#FFFFFF";s:4:"lime";s:7:"#00FF00";s:5:"green";s:7:"#008000";s:4:"navy";s:7:"#000080";s:4:"blue";s:7:"#0000FF";s:4:"aqua";s:7:"#00FFFF";s:4:"teal";s:7:"#008080";s:5:"black";s:7:"#000000";s:6:"silver";s:7:"#C0C0C0";s:4:"gray";s:7:"#808080";}s:25:"ConvertDocumentToFragment";b:1;s:31:"DirectLexLineNumberSyncInterval";i:0;s:8:"Encoding";s:5:"utf-8";s:21:"EscapeInvalidChildren";b:0;s:17:"EscapeInvalidTags";b:0;s:24:"EscapeNonASCIICharacters";b:0;s:14:"HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:8:"Language";s:2:"en";s:9:"LexerImpl";N;s:19:"MaintainLineNumbers";N;s:16:"RemoveInvalidImg";b:1;s:20:"RemoveScriptContents";N;}s:6:"Filter";a:2:{s:26:"ExtractStyleBlocksEscaping";b:1;s:23:"ExtractStyleBlocksScope";N;}s:4:"HTML";a:18:{s:7:"Allowed";N;s:17:"AllowedAttributes";N;s:15:"AllowedElements";N;s:14:"AllowedModules";N;s:12:"BlockWrapper";s:1:"p";s:11:"CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:13:"CustomDoctype";N;s:12:"DefinitionID";N;s:13:"DefinitionRev";i:1;s:7:"Doctype";s:0:"";s:6:"Parent";s:3:"div";s:11:"Proprietary";b:0;s:6:"Strict";b:0;s:7:"TidyAdd";a:0:{}s:9:"TidyLevel";s:6:"medium";s:10:"TidyRemove";a:0:{}s:7:"Trusted";b:0;s:5:"XHTML";b:1;}s:6:"Output";a:3:{s:21:"CommentScriptContents";b:1;s:7:"Newline";N;s:10:"TidyFormat";b:0;}s:4:"Test";a:1:{s:12:"ForceNoIconv";b:0;}s:3:"URI";a:14:{s:14:"AllowedSchemes";a:6:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;}s:4:"Base";N;s:13:"DefaultScheme";s:4:"http";s:12:"DefinitionID";N;s:13:"DefinitionRev";i:1;s:7:"Disable";b:0;s:15:"DisableExternal";b:0;s:24:"DisableExternalResources";b:0;s:16:"DisableResources";b:0;s:4:"Host";N;s:13:"HostBlacklist";a:0:{}s:12:"MakeAbsolute";b:0;s:5:"Munge";N;s:22:"OverrideAllowedSchemes";b:1;}}s:4:"info";a:11:{s:4:"Attr";a:12:{s:19:"AllowedFrameTargets";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"AllowedRel";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"AllowedRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:19:"DefaultInvalidImage";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:22:"DefaultInvalidImageAlt";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"DefaultTextDir";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"EnableID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:17:"HTML.EnableAttrID";}}s:11:"IDBlacklist";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"IDBlacklistRegexp";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"IDPrefix";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"IDPrefixLocal";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"DisableURI";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:3:"URI";s:4:"name";s:7:"Disable";}}s:10:"AutoFormat";a:4:{s:13:"AutoParagraph";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Custom";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Linkify";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:15:"PurifierLinkify";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:15:"AutoFormatParam";a:1:{s:21:"PurifierLinkifyDocURL";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:3:"CSS";a:4:{s:14:"AllowImportant";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"AllowTricky";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"Proprietary";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:5:"Cache";a:2:{s:14:"DefinitionImpl";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:20:"Core.DefinitionCache";}}s:14:"SerializerPath";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:4:"Core";a:20:{s:15:"DefinitionCache";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:5:"Cache";s:4:"name";s:14:"DefinitionImpl";}s:17:"AggressivelyFixLt";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"CollectErrors";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"ColorKeywords";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"hash";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:25:"ConvertDocumentToFragment";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:24:"Core.AcceptFullDocuments";}}s:19:"AcceptFullDocuments";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"Core";s:4:"name";s:25:"ConvertDocumentToFragment";}s:31:"DirectLexLineNumberSyncInterval";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"Encoding";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:7:"istring";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:21:"EscapeInvalidChildren";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"EscapeInvalidTags";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:24:"EscapeNonASCIICharacters";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"HiddenElements";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:8:"Language";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:9:"LexerImpl";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:5:"mixed";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:19:"MaintainLineNumbers";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:16:"RemoveInvalidImg";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:20:"RemoveScriptContents";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"XHTML";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"HTML";s:4:"name";s:5:"XHTML";}s:21:"CommentScriptContents";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:6:"Output";s:4:"name";s:21:"CommentScriptContents";}s:10:"TidyFormat";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:6:"Output";s:4:"name";s:10:"TidyFormat";}}s:6:"Filter";a:2:{s:26:"ExtractStyleBlocksEscaping";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:23:"ExtractStyleBlocksScope";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:4:"HTML";a:19:{s:12:"EnableAttrID";O:37:"HTMLPurifier_ConfigDef_DirectiveAlias":3:{s:5:"class";s:5:"alias";s:9:"namespace";s:4:"Attr";s:4:"name";s:8:"EnableID";}s:7:"Allowed";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:5:"itext";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:17:"AllowedAttributes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:15:"AllowedElements";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:14:"AllowedModules";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"BlockWrapper";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"CoreModules";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"CustomDoctype";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"DefinitionID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Doctype";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:6:{s:0:"";b:1;s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Parent";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:11:"Proprietary";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:6:"Strict";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"TidyAdd";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:9:"TidyLevel";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"TidyRemove";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Trusted";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"XHTML";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:10:"Core.XHTML";}}}s:6:"Output";a:3:{s:21:"CommentScriptContents";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:26:"Core.CommentScriptContents";}}s:7:"Newline";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:10:"TidyFormat";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:15:"Core.TidyFormat";}}}s:4:"Test";a:1:{s:12:"ForceNoIconv";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}s:3:"URI";a:14:{s:14:"AllowedSchemes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"lookup";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:4:"Base";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefaultScheme";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"DefinitionID";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"DefinitionRev";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:3:"int";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:7:"Disable";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:1:{i:0;s:15:"Attr.DisableURI";}}s:15:"DisableExternal";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:24:"DisableExternalResources";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:16:"DisableResources";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:4:"Host";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:13:"HostBlacklist";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"list";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:12:"MakeAbsolute";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:5:"Munge";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:6:"string";s:11:"description";N;s:10:"allow_null";b:1;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}s:22:"OverrideAllowedSchemes";O:32:"HTMLPurifier_ConfigDef_Directive":7:{s:5:"class";s:9:"directive";s:4:"type";s:4:"bool";s:11:"description";N;s:10:"allow_null";b:0;s:7:"allowed";b:1;s:7:"aliases";a:0:{}s:16:"directiveAliases";a:0:{}}}}s:14:"info_namespace";a:11:{s:4:"Attr";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:40:"Features regarding attribute validation.";}s:10:"AutoFormat";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:97:"Configuration for activating auto-formatting functionality (also known as Injectors)";}s:15:"AutoFormatParam";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:59:"Configuration for customizing auto-formatting functionality";}s:3:"CSS";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:36:"Configuration regarding allowed CSS.";}s:5:"Cache";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:57:"Configuration for DefinitionCache and related subclasses.";}s:4:"Core";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:40:"Core features that are always available.";}s:6:"Filter";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:25:"Configuration for filters";}s:4:"HTML";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:37:"Configuration regarding allowed HTML.";}s:6:"Output";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:52:"Configuration relating to the generation of (X)HTML.";}s:4:"Test";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:51:"Developer testing configuration for our unit tests.";}s:3:"URI";O:32:"HTMLPurifier_ConfigDef_Namespace":2:{s:5:"class";s:9:"namespace";s:11:"description";s:48:"Features regarding Uniform Resource Identifiers.";}}s:9:"*parser";O:31:"HTMLPurifier_VarParser_Flexible":0:{}s:5:"types";a:11:{s:6:"string";s:6:"String";s:7:"istring";s:23:"Case-insensitive string";s:4:"text";s:4:"Text";s:5:"itext";s:21:"Case-insensitive text";s:3:"int";s:7:"Integer";s:5:"float";s:5:"Float";s:4:"bool";s:7:"Boolean";s:6:"lookup";s:12:"Lookup array";s:4:"list";s:10:"Array list";s:4:"hash";s:17:"Associative array";s:5:"mixed";s:5:"Mixed";}} \ No newline at end of file diff --git a/library/HTMLPurifier/VarParser.php b/library/HTMLPurifier/VarParser.php index f0235560..1d07329a 100644 --- a/library/HTMLPurifier/VarParser.php +++ b/library/HTMLPurifier/VarParser.php @@ -4,13 +4,13 @@ * Parses string representations into their corresponding native PHP * variable type. */ -class HTMLPurifier_VarParser +abstract class HTMLPurifier_VarParser { /** * Lookup table of allowed types. */ - public $types = array( + static public $types = array( 'string' => true, 'istring' => true, 'text' => true, @@ -25,100 +25,15 @@ class HTMLPurifier_VarParser ); /** - * Validate a variable according to type. Throws exception if invalid. - * It may return NULL as a valid type. + * Validate a variable according to type. Throws + * HTMLPurifier_VarParserException if invalid. + * It may return NULL as a valid type if $allow_null is true. + * + * @param $var Variable to validate + * @param $type Type of variable, see HTMLPurifier_VarParser->types + * @param $allow_null Whether or not to permit null as a value + * @return Validated and type-coerced variable */ - public function parse($var, $type, $allow_null = false) { - if (!isset($this->types[$type])) { - throw new HTMLPurifier_VarParserException("Invalid type $type"); - } - if ($allow_null && $var === null) return null; - switch ($type) { - // Note: if code "breaks" from the switch, it triggers a generic - // exception to be thrown. Specific errors can be specifically - // done here. - case 'mixed': - //if (is_string($var)) $var = unserialize($var); - return $var; - case 'istring': - case 'string': - case 'text': // no difference, just is longer/multiple line string - case 'itext': - if (!is_string($var)) break; - if ($type === 'istring' || $type === 'itext') $var = strtolower($var); - return $var; - case 'int': - if (is_string($var) && ctype_digit($var)) $var = (int) $var; - elseif (!is_int($var)) break; - return $var; - case 'float': - if (is_string($var) && is_numeric($var)) $var = (float) $var; - elseif (!is_float($var)) break; - return $var; - case 'bool': - if (is_int($var) && ($var === 0 || $var === 1)) { - $var = (bool) $var; - } elseif (is_string($var)) { - if ($var == 'on' || $var == 'true' || $var == '1') { - $var = true; - } elseif ($var == 'off' || $var == 'false' || $var == '0') { - $var = false; - } else { - throw new HTMLPurifier_VarParserException("Unrecognized value '$var' for $type"); - } - } elseif (!is_bool($var)) break; - return $var; - case 'list': - case 'hash': - case 'lookup': - if (is_string($var)) { - // special case: technically, this is an array with - // a single empty string item, but having an empty - // array is more intuitive - if ($var == '') return array(); - if (strpos($var, "\n") === false && strpos($var, "\r") === false) { - // simplistic string to array method that only works - // for simple lists of tag names or alphanumeric characters - $var = explode(',',$var); - } else { - $var = preg_split('/(,|[\n\r]+)/', $var); - } - // remove spaces - foreach ($var as $i => $j) $var[$i] = trim($j); - if ($type === 'hash') { - // key:value,key2:value2 - $nvar = array(); - foreach ($var as $keypair) { - $c = explode(':', $keypair, 2); - if (!isset($c[1])) continue; - $nvar[$c[0]] = $c[1]; - } - $var = $nvar; - } - } - if (!is_array($var)) break; - $keys = array_keys($var); - if ($keys === array_keys($keys)) { - if ($type == 'list') return $var; - elseif ($type == 'lookup') { - $new = array(); - foreach ($var as $key) { - $new[$key] = true; - } - return $new; - } else break; - } - if ($type === 'lookup') { - foreach ($var as $key => $value) { - $var[$key] = true; - } - } - return $var; - default: - // This should not happen! - throw new HTMLPurifier_Exception("Inconsistency in HTMLPurifier_VarParser: $type is not implemented"); - } - throw new HTMLPurifier_VarParserException("Invalid input for type $type"); - } + abstract public function parse($var, $type, $allow_null = false); } diff --git a/library/HTMLPurifier/VarParser/Flexible.php b/library/HTMLPurifier/VarParser/Flexible.php new file mode 100644 index 00000000..fcec974b --- /dev/null +++ b/library/HTMLPurifier/VarParser/Flexible.php @@ -0,0 +1,103 @@ + $j) $var[$i] = trim($j); + if ($type === 'hash') { + // key:value,key2:value2 + $nvar = array(); + foreach ($var as $keypair) { + $c = explode(':', $keypair, 2); + if (!isset($c[1])) continue; + $nvar[$c[0]] = $c[1]; + } + $var = $nvar; + } + } + if (!is_array($var)) break; + $keys = array_keys($var); + if ($keys === array_keys($keys)) { + if ($type == 'list') return $var; + elseif ($type == 'lookup') { + $new = array(); + foreach ($var as $key) { + $new[$key] = true; + } + return $new; + } else break; + } + if ($type === 'lookup') { + foreach ($var as $key => $value) { + $var[$key] = true; + } + } + return $var; + default: + // This should not happen! + throw new HTMLPurifier_Exception("Inconsistency in HTMLPurifier_VarParser_Flexible: $type is not implemented"); + } + throw new HTMLPurifier_VarParserException("Invalid input for type $type"); + } + +} diff --git a/tests/HTMLPurifier/VarParserTest.php b/tests/HTMLPurifier/VarParser/FlexibleTest.php similarity index 77% rename from tests/HTMLPurifier/VarParserTest.php rename to tests/HTMLPurifier/VarParser/FlexibleTest.php index 84137e34..4578460e 100644 --- a/tests/HTMLPurifier/VarParserTest.php +++ b/tests/HTMLPurifier/VarParser/FlexibleTest.php @@ -1,32 +1,8 @@ parser = new HTMLPurifier_VarParser(); - } - - function assertValid($var, $type, $ret = null) { - $ret = ($ret === null) ? $var : $ret; - $this->assertIdentical($this->parser->parse($var, $type), $ret); - } - - function assertInvalid($var, $type, $msg = null) { - $caught = false; - try { - $this->parser->parse($var, $type); - } catch (HTMLPurifier_VarParserException $e) { - $caught = true; - if ($msg !== null) $this->assertIdentical($e->getMessage(), $msg); - } - if (!$caught) { - $this->fail('Did not catch expected error'); - } - } - function testValidate() { $this->assertValid('foobar', 'string'); diff --git a/tests/HTMLPurifier/VarParserHarness.php b/tests/HTMLPurifier/VarParserHarness.php new file mode 100644 index 00000000..59eb6965 --- /dev/null +++ b/tests/HTMLPurifier/VarParserHarness.php @@ -0,0 +1,31 @@ +parser = new $class(); + } + + function assertValid($var, $type, $ret = null) { + $ret = ($ret === null) ? $var : $ret; + $this->assertIdentical($this->parser->parse($var, $type), $ret); + } + + function assertInvalid($var, $type, $msg = null) { + $caught = false; + try { + $this->parser->parse($var, $type); + } catch (HTMLPurifier_VarParserException $e) { + $caught = true; + if ($msg !== null) $this->assertIdentical($e->getMessage(), $msg); + } + if (!$caught) { + $this->fail('Did not catch expected error'); + } + } + +}