0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 08:21:52 +00:00

Handle CRLF discrepancies

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang 2008-06-24 21:10:51 -04:00
parent a84b6d5be0
commit 6bb8c1fcac
99 changed files with 6183 additions and 6183 deletions

View File

@ -1,8 +1,8 @@
Licensing of Specimens Licensing of Specimens
Some files in this directory have different licenses: Some files in this directory have different licenses:
windows-live-mail-desktop-beta.html - donated by laacz, public domain windows-live-mail-desktop-beta.html - donated by laacz, public domain
img.png - LGPL, from <http://commons.wikimedia.org/wiki/Image:Pastille_chrome.png> img.png - LGPL, from <http://commons.wikimedia.org/wiki/Image:Pastille_chrome.png>
All other files are by me, and are licensed under LGPL. All other files are by me, and are licensed under LGPL.

View File

@ -1,189 +1,189 @@
<?php <?php
/** /**
* @file * @file
* This file was auto-generated by generate-includes.php and includes all of * This file was auto-generated by generate-includes.php and includes all of
* the core files required by HTML Purifier. This is a convenience stub that * the core files required by HTML Purifier. This is a convenience stub that
* includes all files using dirname(__FILE__) and require_once. PLEASE DO NOT * includes all files using dirname(__FILE__) and require_once. PLEASE DO NOT
* EDIT THIS FILE, changes will be overwritten the next time the script is run. * EDIT THIS FILE, changes will be overwritten the next time the script is run.
* *
* Changes to include_path are not necessary. * Changes to include_path are not necessary.
*/ */
$__dir = dirname(__FILE__); $__dir = dirname(__FILE__);
require_once $__dir . '/HTMLPurifier.php'; require_once $__dir . '/HTMLPurifier.php';
require_once $__dir . '/HTMLPurifier/AttrCollections.php'; require_once $__dir . '/HTMLPurifier/AttrCollections.php';
require_once $__dir . '/HTMLPurifier/AttrDef.php'; require_once $__dir . '/HTMLPurifier/AttrDef.php';
require_once $__dir . '/HTMLPurifier/AttrTransform.php'; require_once $__dir . '/HTMLPurifier/AttrTransform.php';
require_once $__dir . '/HTMLPurifier/AttrTypes.php'; require_once $__dir . '/HTMLPurifier/AttrTypes.php';
require_once $__dir . '/HTMLPurifier/AttrValidator.php'; require_once $__dir . '/HTMLPurifier/AttrValidator.php';
require_once $__dir . '/HTMLPurifier/Bootstrap.php'; require_once $__dir . '/HTMLPurifier/Bootstrap.php';
require_once $__dir . '/HTMLPurifier/Definition.php'; require_once $__dir . '/HTMLPurifier/Definition.php';
require_once $__dir . '/HTMLPurifier/CSSDefinition.php'; require_once $__dir . '/HTMLPurifier/CSSDefinition.php';
require_once $__dir . '/HTMLPurifier/ChildDef.php'; require_once $__dir . '/HTMLPurifier/ChildDef.php';
require_once $__dir . '/HTMLPurifier/Config.php'; require_once $__dir . '/HTMLPurifier/Config.php';
require_once $__dir . '/HTMLPurifier/ConfigSchema.php'; require_once $__dir . '/HTMLPurifier/ConfigSchema.php';
require_once $__dir . '/HTMLPurifier/ContentSets.php'; require_once $__dir . '/HTMLPurifier/ContentSets.php';
require_once $__dir . '/HTMLPurifier/Context.php'; require_once $__dir . '/HTMLPurifier/Context.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache.php';
require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php'; require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php';
require_once $__dir . '/HTMLPurifier/Doctype.php'; require_once $__dir . '/HTMLPurifier/Doctype.php';
require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php'; require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php';
require_once $__dir . '/HTMLPurifier/ElementDef.php'; require_once $__dir . '/HTMLPurifier/ElementDef.php';
require_once $__dir . '/HTMLPurifier/Encoder.php'; require_once $__dir . '/HTMLPurifier/Encoder.php';
require_once $__dir . '/HTMLPurifier/EntityLookup.php'; require_once $__dir . '/HTMLPurifier/EntityLookup.php';
require_once $__dir . '/HTMLPurifier/EntityParser.php'; require_once $__dir . '/HTMLPurifier/EntityParser.php';
require_once $__dir . '/HTMLPurifier/ErrorCollector.php'; require_once $__dir . '/HTMLPurifier/ErrorCollector.php';
require_once $__dir . '/HTMLPurifier/Exception.php'; require_once $__dir . '/HTMLPurifier/Exception.php';
require_once $__dir . '/HTMLPurifier/Filter.php'; require_once $__dir . '/HTMLPurifier/Filter.php';
require_once $__dir . '/HTMLPurifier/Generator.php'; require_once $__dir . '/HTMLPurifier/Generator.php';
require_once $__dir . '/HTMLPurifier/HTMLDefinition.php'; require_once $__dir . '/HTMLPurifier/HTMLDefinition.php';
require_once $__dir . '/HTMLPurifier/HTMLModule.php'; require_once $__dir . '/HTMLPurifier/HTMLModule.php';
require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php'; require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php';
require_once $__dir . '/HTMLPurifier/IDAccumulator.php'; require_once $__dir . '/HTMLPurifier/IDAccumulator.php';
require_once $__dir . '/HTMLPurifier/Injector.php'; require_once $__dir . '/HTMLPurifier/Injector.php';
require_once $__dir . '/HTMLPurifier/Language.php'; require_once $__dir . '/HTMLPurifier/Language.php';
require_once $__dir . '/HTMLPurifier/LanguageFactory.php'; require_once $__dir . '/HTMLPurifier/LanguageFactory.php';
require_once $__dir . '/HTMLPurifier/Length.php'; require_once $__dir . '/HTMLPurifier/Length.php';
require_once $__dir . '/HTMLPurifier/Lexer.php'; require_once $__dir . '/HTMLPurifier/Lexer.php';
require_once $__dir . '/HTMLPurifier/PercentEncoder.php'; require_once $__dir . '/HTMLPurifier/PercentEncoder.php';
require_once $__dir . '/HTMLPurifier/Strategy.php'; require_once $__dir . '/HTMLPurifier/Strategy.php';
require_once $__dir . '/HTMLPurifier/StringHash.php'; require_once $__dir . '/HTMLPurifier/StringHash.php';
require_once $__dir . '/HTMLPurifier/StringHashParser.php'; require_once $__dir . '/HTMLPurifier/StringHashParser.php';
require_once $__dir . '/HTMLPurifier/TagTransform.php'; require_once $__dir . '/HTMLPurifier/TagTransform.php';
require_once $__dir . '/HTMLPurifier/Token.php'; require_once $__dir . '/HTMLPurifier/Token.php';
require_once $__dir . '/HTMLPurifier/TokenFactory.php'; require_once $__dir . '/HTMLPurifier/TokenFactory.php';
require_once $__dir . '/HTMLPurifier/URI.php'; require_once $__dir . '/HTMLPurifier/URI.php';
require_once $__dir . '/HTMLPurifier/URIDefinition.php'; require_once $__dir . '/HTMLPurifier/URIDefinition.php';
require_once $__dir . '/HTMLPurifier/URIFilter.php'; require_once $__dir . '/HTMLPurifier/URIFilter.php';
require_once $__dir . '/HTMLPurifier/URIParser.php'; require_once $__dir . '/HTMLPurifier/URIParser.php';
require_once $__dir . '/HTMLPurifier/URIScheme.php'; require_once $__dir . '/HTMLPurifier/URIScheme.php';
require_once $__dir . '/HTMLPurifier/URISchemeRegistry.php'; require_once $__dir . '/HTMLPurifier/URISchemeRegistry.php';
require_once $__dir . '/HTMLPurifier/UnitConverter.php'; require_once $__dir . '/HTMLPurifier/UnitConverter.php';
require_once $__dir . '/HTMLPurifier/VarParser.php'; require_once $__dir . '/HTMLPurifier/VarParser.php';
require_once $__dir . '/HTMLPurifier/VarParserException.php'; require_once $__dir . '/HTMLPurifier/VarParserException.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Enum.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Enum.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Integer.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Integer.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Lang.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Switch.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Switch.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Text.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Text.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php'; require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeEmbed.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeObject.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/SafeObject.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeParam.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/SafeParam.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php'; require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Required.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Required.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php';
require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php'; require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Table.php'; require_once $__dir . '/HTMLPurifier/ChildDef/Table.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeEmbed.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeObject.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/SafeObject.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php'; require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php'; require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php'; require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php'; require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php'; require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php';
require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php'; require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php';
require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php'; require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php';
require_once $__dir . '/HTMLPurifier/Strategy/Composite.php'; require_once $__dir . '/HTMLPurifier/Strategy/Composite.php';
require_once $__dir . '/HTMLPurifier/Strategy/Core.php'; require_once $__dir . '/HTMLPurifier/Strategy/Core.php';
require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php'; require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php';
require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php'; require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php';
require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php'; require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php';
require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php'; require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Font.php'; require_once $__dir . '/HTMLPurifier/TagTransform/Font.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php'; require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php';
require_once $__dir . '/HTMLPurifier/Token/Comment.php'; require_once $__dir . '/HTMLPurifier/Token/Comment.php';
require_once $__dir . '/HTMLPurifier/Token/Tag.php'; require_once $__dir . '/HTMLPurifier/Token/Tag.php';
require_once $__dir . '/HTMLPurifier/Token/Empty.php'; require_once $__dir . '/HTMLPurifier/Token/Empty.php';
require_once $__dir . '/HTMLPurifier/Token/End.php'; require_once $__dir . '/HTMLPurifier/Token/End.php';
require_once $__dir . '/HTMLPurifier/Token/Start.php'; require_once $__dir . '/HTMLPurifier/Token/Start.php';
require_once $__dir . '/HTMLPurifier/Token/Text.php'; require_once $__dir . '/HTMLPurifier/Token/Text.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php'; require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php'; require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php';
require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php'; require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php';
require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php'; require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php';
require_once $__dir . '/HTMLPurifier/URIFilter/Munge.php'; require_once $__dir . '/HTMLPurifier/URIFilter/Munge.php';
require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php'; require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php';
require_once $__dir . '/HTMLPurifier/URIScheme/http.php'; require_once $__dir . '/HTMLPurifier/URIScheme/http.php';
require_once $__dir . '/HTMLPurifier/URIScheme/https.php'; require_once $__dir . '/HTMLPurifier/URIScheme/https.php';
require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php'; require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php';
require_once $__dir . '/HTMLPurifier/URIScheme/news.php'; require_once $__dir . '/HTMLPurifier/URIScheme/news.php';
require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php'; require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php';
require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php'; require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php';
require_once $__dir . '/HTMLPurifier/VarParser/Native.php'; require_once $__dir . '/HTMLPurifier/VarParser/Native.php';

View File

@ -1,11 +1,11 @@
Attr.AllowedFrameTargets Attr.AllowedFrameTargets
TYPE: lookup TYPE: lookup
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
Lookup table of all allowed link frame targets. Some commonly used link Lookup table of all allowed link frame targets. Some commonly used link
targets include _blank, _self, _parent and _top. Values should be targets include _blank, _self, _parent and _top. Values should be
lowercase, as validation will be done in a case-sensitive manner despite lowercase, as validation will be done in a case-sensitive manner despite
W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute
so this directive will have no effect in that doctype. XHTML 1.1 does not so this directive will have no effect in that doctype. XHTML 1.1 does not
enable the Target module by default, you will have to manually enable it enable the Target module by default, you will have to manually enable it
(see the module documentation for more details.) (see the module documentation for more details.)

View File

@ -1,8 +1,8 @@
Attr.AllowedRel Attr.AllowedRel
TYPE: lookup TYPE: lookup
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of allowed forward document relationships in the rel attribute. Common List of allowed forward document relationships in the rel attribute. Common
values may be nofollow or print. By default, this is empty, meaning that no values may be nofollow or print. By default, this is empty, meaning that no
document relationships are allowed. document relationships are allowed.

View File

@ -1,8 +1,8 @@
Attr.AllowedRev Attr.AllowedRev
TYPE: lookup TYPE: lookup
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of allowed reverse document relationships in the rev attribute. This List of allowed reverse document relationships in the rev attribute. This
attribute is a bit of an edge-case; if you don't know what it is for, stay attribute is a bit of an edge-case; if you don't know what it is for, stay
away. away.

View File

@ -1,8 +1,8 @@
Attr.DefaultInvalidImage Attr.DefaultInvalidImage
TYPE: string TYPE: string
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
This is the default image an img tag will be pointed to if it does not have This is the default image an img tag will be pointed to if it does not have
a valid src attribute. In future versions, we may allow the image tag to a valid src attribute. In future versions, we may allow the image tag to
be removed completely, but due to design issues, this is not possible right be removed completely, but due to design issues, this is not possible right
now. now.

View File

@ -1,7 +1,7 @@
Attr.DefaultInvalidImageAlt Attr.DefaultInvalidImageAlt
TYPE: string TYPE: string
DEFAULT: 'Invalid image' DEFAULT: 'Invalid image'
--DESCRIPTION-- --DESCRIPTION--
This is the content of the alt tag of an invalid image if the user had not This is the content of the alt tag of an invalid image if the user had not
previously specified an alt attribute. It has no effect when the image is previously specified an alt attribute. It has no effect when the image is
valid but there was no alt attribute present. valid but there was no alt attribute present.

View File

@ -1,9 +1,9 @@
Attr.DefaultTextDir Attr.DefaultTextDir
TYPE: string TYPE: string
DEFAULT: 'ltr' DEFAULT: 'ltr'
--DESCRIPTION-- --DESCRIPTION--
Defines the default text direction (ltr or rtl) of the document being Defines the default text direction (ltr or rtl) of the document being
parsed. This generally is the same as the value of the dir attribute in parsed. This generally is the same as the value of the dir attribute in
HTML, or ltr if that is not specified. HTML, or ltr if that is not specified.
--ALLOWED-- --ALLOWED--
'ltr', 'rtl' 'ltr', 'rtl'

View File

@ -1,15 +1,15 @@
Attr.EnableID Attr.EnableID
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 1.2.0 VERSION: 1.2.0
--DESCRIPTION-- --DESCRIPTION--
Allows the ID attribute in HTML. This is disabled by default due to the Allows the ID attribute in HTML. This is disabled by default due to the
fact that without proper configuration user input can easily break the fact that without proper configuration user input can easily break the
validation of a webpage by specifying an ID that is already on the validation of a webpage by specifying an ID that is already on the
surrounding HTML. If you don't mind throwing caution to the wind, enable surrounding HTML. If you don't mind throwing caution to the wind, enable
this directive, but I strongly recommend you also consider blacklisting IDs this directive, but I strongly recommend you also consider blacklisting IDs
you use (%Attr.IDBlacklist) or prefixing all user supplied IDs you use (%Attr.IDBlacklist) or prefixing all user supplied IDs
(%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of (%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of
pre-1.2.0 versions. pre-1.2.0 versions.
--ALIASES-- --ALIASES--
HTML.EnableAttrID HTML.EnableAttrID

View File

@ -1,4 +1,4 @@
Attr.IDBlacklist Attr.IDBlacklist
TYPE: list TYPE: list
DEFAULT: array() DEFAULT: array()
DESCRIPTION: Array of IDs not allowed in the document. DESCRIPTION: Array of IDs not allowed in the document.

View File

@ -1,8 +1,8 @@
Attr.IDBlacklistRegexp Attr.IDBlacklistRegexp
TYPE: string/null TYPE: string/null
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
PCRE regular expression to be matched against all IDs. If the expression is PCRE regular expression to be matched against all IDs. If the expression is
matches, the ID is rejected. Use this with care: may cause significant matches, the ID is rejected. Use this with care: may cause significant
degradation. ID matching is done after all other validation. degradation. ID matching is done after all other validation.

View File

@ -1,11 +1,11 @@
Attr.IDPrefix Attr.IDPrefix
TYPE: string TYPE: string
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
String to prefix to IDs. If you have no idea what IDs your pages may use, String to prefix to IDs. If you have no idea what IDs your pages may use,
you may opt to simply add a prefix to all user-submitted ID attributes so you may opt to simply add a prefix to all user-submitted ID attributes so
that they are still usable, but will not conflict with core page IDs. that they are still usable, but will not conflict with core page IDs.
Example: setting the directive to 'user_' will result in a user submitted Example: setting the directive to 'user_' will result in a user submitted
'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true 'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true
before using this. before using this.

View File

@ -1,13 +1,13 @@
Attr.IDPrefixLocal Attr.IDPrefixLocal
TYPE: string TYPE: string
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you
need to allow multiple sets of user content on web page, you may need to need to allow multiple sets of user content on web page, you may need to
have a seperate prefix that changes with each iteration. This way, have a seperate prefix that changes with each iteration. This way,
seperately submitted user content displayed on the same page doesn't seperately submitted user content displayed on the same page doesn't
clobber each other. Ideal values are unique identifiers for the content it clobber each other. Ideal values are unique identifiers for the content it
represents (i.e. the id of the row in the database). Be sure to add a represents (i.e. the id of the row in the database). Be sure to add a
seperator (like an underscore) at the end. Warning: this directive will seperator (like an underscore) at the end. Warning: this directive will
not work unless %Attr.IDPrefix is set to a non-empty value! not work unless %Attr.IDPrefix is set to a non-empty value!

View File

@ -1,2 +1,2 @@
Attr Attr
DESCRIPTION: Features regarding attribute validation. DESCRIPTION: Features regarding attribute validation.

View File

@ -1,30 +1,30 @@
AutoFormat.AutoParagraph AutoFormat.AutoParagraph
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive turns on auto-paragraphing, where double newlines are This directive turns on auto-paragraphing, where double newlines are
converted in to paragraphs whenever possible. Auto-paragraphing: converted in to paragraphs whenever possible. Auto-paragraphing:
</p> </p>
<ul> <ul>
<li>Always applies to inline elements or text in the root node,</li> <li>Always applies to inline elements or text in the root node,</li>
<li>Applies to inline elements or text with double newlines in nodes <li>Applies to inline elements or text with double newlines in nodes
that allow paragraph tags,</li> that allow paragraph tags,</li>
<li>Applies to double newlines in paragraph tags</li> <li>Applies to double newlines in paragraph tags</li>
</ul> </ul>
<p> <p>
<code>p</code> tags must be allowed for this directive to take effect. <code>p</code> tags must be allowed for this directive to take effect.
We do not use <code>br</code> tags for paragraphing, as that is We do not use <code>br</code> tags for paragraphing, as that is
semantically incorrect. semantically incorrect.
</p> </p>
<p> <p>
To prevent auto-paragraphing as a content-producer, refrain from using To prevent auto-paragraphing as a content-producer, refrain from using
double-newlines except to specify a new paragraph or in contexts where double-newlines except to specify a new paragraph or in contexts where
it has special meaning (whitespace usually has no meaning except in it has special meaning (whitespace usually has no meaning except in
tags like <code>pre</code>, so this should not be difficult.) To prevent tags like <code>pre</code>, so this should not be difficult.) To prevent
the paragraphing of inline text adjacent to block elements, wrap them the paragraphing of inline text adjacent to block elements, wrap them
in <code>div</code> tags (the behavior is slightly different outside of in <code>div</code> tags (the behavior is slightly different outside of
the root node.) the root node.)
</p> </p>

View File

@ -1,12 +1,12 @@
AutoFormat.Custom AutoFormat.Custom
TYPE: list TYPE: list
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive can be used to add custom auto-format injectors. This directive can be used to add custom auto-format injectors.
Specify an array of injector names (class name minus the prefix) Specify an array of injector names (class name minus the prefix)
or concrete implementations. Injector class must exist. or concrete implementations. Injector class must exist.
</p> </p>

View File

@ -1,12 +1,12 @@
AutoFormat.Linkify AutoFormat.Linkify
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive turns on linkification, auto-linking http, ftp and This directive turns on linkification, auto-linking http, ftp and
https URLs. <code>a</code> tags with the <code>href</code> attribute https URLs. <code>a</code> tags with the <code>href</code> attribute
must be allowed. must be allowed.
</p> </p>

View File

@ -1,12 +1,12 @@
AutoFormat.PurifierLinkify AutoFormat.PurifierLinkify
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Internal auto-formatter that converts configuration directives in Internal auto-formatter that converts configuration directives in
syntax <a>%Namespace.Directive</a> to links. <code>a</code> tags syntax <a>%Namespace.Directive</a> to links. <code>a</code> tags
with the <code>href</code> attribute must be allowed. with the <code>href</code> attribute must be allowed.
</p> </p>

View File

@ -1,2 +1,2 @@
AutoFormat AutoFormat
DESCRIPTION: Configuration for activating auto-formatting functionality (also known as <code>Injector</code>s) DESCRIPTION: Configuration for activating auto-formatting functionality (also known as <code>Injector</code>s)

View File

@ -1,12 +1,12 @@
AutoFormatParam.PurifierLinkifyDocURL AutoFormatParam.PurifierLinkifyDocURL
TYPE: string TYPE: string
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: '#%s' DEFAULT: '#%s'
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Location of configuration documentation to link to, let %s substitute Location of configuration documentation to link to, let %s substitute
into the configuration's namespace and directive names sans the percent into the configuration's namespace and directive names sans the percent
sign. sign.
</p> </p>

View File

@ -1,2 +1,2 @@
AutoFormatParam AutoFormatParam
DESCRIPTION: Configuration for customizing auto-formatting functionality DESCRIPTION: Configuration for customizing auto-formatting functionality

View File

@ -1,11 +1,11 @@
CSS.DefinitionRev CSS.DefinitionRev
TYPE: int TYPE: int
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 1 DEFAULT: 1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Revision identifier for your custom definition. See Revision identifier for your custom definition. See
%HTML.DefinitionRev for details. %HTML.DefinitionRev for details.
</p> </p>

View File

@ -1,10 +1,10 @@
CSS.Proprietary CSS.Proprietary
TYPE: bool TYPE: bool
VERSION: 3.0.0 VERSION: 3.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Whether or not to allow safe, proprietary CSS values. Whether or not to allow safe, proprietary CSS values.
</p> </p>

View File

@ -1,2 +1,2 @@
CSS CSS
DESCRIPTION: Configuration regarding allowed CSS. DESCRIPTION: Configuration regarding allowed CSS.

View File

@ -1,13 +1,13 @@
Cache.DefinitionImpl Cache.DefinitionImpl
TYPE: string/null TYPE: string/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 'Serializer' DEFAULT: 'Serializer'
--DESCRIPTION-- --DESCRIPTION--
This directive defines which method to use when caching definitions, This directive defines which method to use when caching definitions,
the complex data-type that makes HTML Purifier tick. Set to null the complex data-type that makes HTML Purifier tick. Set to null
to disable caching (not recommended, as you will see a definite to disable caching (not recommended, as you will see a definite
performance degradation). performance degradation).
--ALIASES-- --ALIASES--
Core.DefinitionCache Core.DefinitionCache

View File

@ -1,13 +1,13 @@
Cache.SerializerPath Cache.SerializerPath
TYPE: string/null TYPE: string/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Absolute path with no trailing slash to store serialized definitions in. Absolute path with no trailing slash to store serialized definitions in.
Default is within the Default is within the
HTML Purifier library inside DefinitionCache/Serializer. This HTML Purifier library inside DefinitionCache/Serializer. This
path must be writable by the webserver. path must be writable by the webserver.
</p> </p>

View File

@ -1,2 +1,2 @@
Cache Cache
DESCRIPTION: Configuration for DefinitionCache and related subclasses. DESCRIPTION: Configuration for DefinitionCache and related subclasses.

View File

@ -1,13 +1,13 @@
Core.AggressivelyFixLt Core.AggressivelyFixLt
TYPE: bool TYPE: bool
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
This directive enables aggressive pre-filter fixes HTML Purifier can This directive enables aggressive pre-filter fixes HTML Purifier can
perform in order to ensure that open angled-brackets do not get killed perform in order to ensure that open angled-brackets do not get killed
during parsing stage. Enabling this will result in two preg_replace_callback during parsing stage. Enabling this will result in two preg_replace_callback
calls and one preg_replace call for every bit of HTML passed through here. calls and one preg_replace call for every bit of HTML passed through here.
It is not necessary and will have no effect for PHP 4. It is not necessary and will have no effect for PHP 4.

View File

@ -1,11 +1,11 @@
Core.CollectErrors Core.CollectErrors
TYPE: bool TYPE: bool
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Whether or not to collect errors found while filtering the document. This Whether or not to collect errors found while filtering the document. This
is a useful way to give feedback to your users. <strong>Warning:</strong> is a useful way to give feedback to your users. <strong>Warning:</strong>
Currently this feature is very patchy and experimental, with lots of Currently this feature is very patchy and experimental, with lots of
possible error messages not yet implemented. It will not cause any possible error messages not yet implemented. It will not cause any
problems, but it may not help your users either. problems, but it may not help your users either.

View File

@ -1,29 +1,29 @@
Core.ColorKeywords Core.ColorKeywords
TYPE: hash TYPE: hash
VERSION: 2.0.0 VERSION: 2.0.0
--DEFAULT-- --DEFAULT--
array ( array (
'maroon' => '#800000', 'maroon' => '#800000',
'red' => '#FF0000', 'red' => '#FF0000',
'orange' => '#FFA500', 'orange' => '#FFA500',
'yellow' => '#FFFF00', 'yellow' => '#FFFF00',
'olive' => '#808000', 'olive' => '#808000',
'purple' => '#800080', 'purple' => '#800080',
'fuchsia' => '#FF00FF', 'fuchsia' => '#FF00FF',
'white' => '#FFFFFF', 'white' => '#FFFFFF',
'lime' => '#00FF00', 'lime' => '#00FF00',
'green' => '#008000', 'green' => '#008000',
'navy' => '#000080', 'navy' => '#000080',
'blue' => '#0000FF', 'blue' => '#0000FF',
'aqua' => '#00FFFF', 'aqua' => '#00FFFF',
'teal' => '#008080', 'teal' => '#008080',
'black' => '#000000', 'black' => '#000000',
'silver' => '#C0C0C0', 'silver' => '#C0C0C0',
'gray' => '#808080', 'gray' => '#808080',
) )
--DESCRIPTION-- --DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. to color, with preceding hash mark. Used when parsing colors.

View File

@ -1,13 +1,13 @@
Core.ConvertDocumentToFragment Core.ConvertDocumentToFragment
TYPE: bool TYPE: bool
DEFAULT: true DEFAULT: true
--DESCRIPTION-- --DESCRIPTION--
This parameter determines whether or not the filter should convert This parameter determines whether or not the filter should convert
input that is a full document with html and body tags to a fragment input that is a full document with html and body tags to a fragment
of just the contents of a body tag. This parameter is simply something of just the contents of a body tag. This parameter is simply something
HTML Purifier can do during an edge-case: for most inputs, this HTML Purifier can do during an edge-case: for most inputs, this
processing is not necessary. processing is not necessary.
--ALIASES-- --ALIASES--
Core.AcceptFullDocuments Core.AcceptFullDocuments

View File

@ -1,17 +1,17 @@
Core.DirectLexLineNumberSyncInterval Core.DirectLexLineNumberSyncInterval
TYPE: int TYPE: int
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 0 DEFAULT: 0
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Specifies the number of tokens the DirectLex line number tracking Specifies the number of tokens the DirectLex line number tracking
implementations should process before attempting to resyncronize the implementations should process before attempting to resyncronize the
current line count by manually counting all previous new-lines. When current line count by manually counting all previous new-lines. When
at 0, this functionality is disabled. Lower values will decrease at 0, this functionality is disabled. Lower values will decrease
performance, and this is only strictly necessary if the counting performance, and this is only strictly necessary if the counting
algorithm is buggy (in which case you should report it as a bug). algorithm is buggy (in which case you should report it as a bug).
This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is
not being used. not being used.
</p> </p>

View File

@ -1,14 +1,14 @@
Core.Encoding Core.Encoding
TYPE: istring TYPE: istring
DEFAULT: 'utf-8' DEFAULT: 'utf-8'
--DESCRIPTION-- --DESCRIPTION--
If for some reason you are unable to convert all webpages to UTF-8, you can If for some reason you are unable to convert all webpages to UTF-8, you can
use this directive as a stop-gap compatibility change to let HTML Purifier use this directive as a stop-gap compatibility change to let HTML Purifier
deal with non UTF-8 input. This technique has notable deficiencies: deal with non UTF-8 input. This technique has notable deficiencies:
absolutely no characters outside of the selected character encoding will be absolutely no characters outside of the selected character encoding will be
preserved, not even the ones that have been ampersand escaped (this is due preserved, not even the ones that have been ampersand escaped (this is due
to a UTF-8 specific <em>feature</em> that automatically resolves all to a UTF-8 specific <em>feature</em> that automatically resolves all
entities), making it pretty useless for anything except the most I18N-blind entities), making it pretty useless for anything except the most I18N-blind
applications, although %Core.EscapeNonASCIICharacters offers fixes this applications, although %Core.EscapeNonASCIICharacters offers fixes this
trouble with another tradeoff. This directive only accepts ISO-8859-1 if trouble with another tradeoff. This directive only accepts ISO-8859-1 if
iconv is not enabled. iconv is not enabled.

View File

@ -1,9 +1,9 @@
Core.EscapeInvalidChildren Core.EscapeInvalidChildren
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
When true, a child is found that is not allowed in the context of the When true, a child is found that is not allowed in the context of the
parent element will be transformed into text as if it were ASCII. When parent element will be transformed into text as if it were ASCII. When
false, that element and all internal tags will be dropped, though text will false, that element and all internal tags will be dropped, though text will
be preserved. There is no option for dropping the element but preserving be preserved. There is no option for dropping the element but preserving
child nodes. child nodes.

View File

@ -1,6 +1,6 @@
Core.EscapeInvalidTags Core.EscapeInvalidTags
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
When true, invalid tags will be written back to the document as plain text. When true, invalid tags will be written back to the document as plain text.
Otherwise, they are silently dropped. Otherwise, they are silently dropped.

View File

@ -1,12 +1,12 @@
Core.EscapeNonASCIICharacters Core.EscapeNonASCIICharacters
TYPE: bool TYPE: bool
VERSION: 1.4.0 VERSION: 1.4.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
This directive overcomes a deficiency in %Core.Encoding by blindly This directive overcomes a deficiency in %Core.Encoding by blindly
converting all non-ASCII characters into decimal numeric entities before converting all non-ASCII characters into decimal numeric entities before
converting it to its native encoding. This means that even characters that converting it to its native encoding. This means that even characters that
can be expressed in the non-UTF-8 encoding will be entity-ized, which can can be expressed in the non-UTF-8 encoding will be entity-ized, which can
be a real downer for encodings like Big5. It also assumes that the ASCII be a real downer for encodings like Big5. It also assumes that the ASCII
repetoire is available, although this is the case for almost all encodings. repetoire is available, although this is the case for almost all encodings.
Anyway, use UTF-8! Anyway, use UTF-8!

View File

@ -1,19 +1,19 @@
Core.HiddenElements Core.HiddenElements
TYPE: lookup TYPE: lookup
--DEFAULT-- --DEFAULT--
array ( array (
'script' => true, 'script' => true,
'style' => true, 'style' => true,
) )
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive is a lookup array of elements which should have their This directive is a lookup array of elements which should have their
contents removed when they are not allowed by the HTML definition. contents removed when they are not allowed by the HTML definition.
For example, the contents of a <code>script</code> tag are not For example, the contents of a <code>script</code> tag are not
normally shown in a document, so if script tags are to be removed, normally shown in a document, so if script tags are to be removed,
their contents should be removed to. This is opposed to a <code>b</code> their contents should be removed to. This is opposed to a <code>b</code>
tag, which defines some presentational changes but does not hide its tag, which defines some presentational changes but does not hide its
contents. contents.
</p> </p>

View File

@ -1,11 +1,11 @@
Core.Language Core.Language
TYPE: string TYPE: string
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 'en' DEFAULT: 'en'
--DESCRIPTION-- --DESCRIPTION--
ISO 639 language code for localizable things in HTML Purifier to use, ISO 639 language code for localizable things in HTML Purifier to use,
which is mainly error reporting. There is currently only an English (en) which is mainly error reporting. There is currently only an English (en)
translation, so this directive is currently useless. translation, so this directive is currently useless.

View File

@ -1,33 +1,33 @@
Core.LexerImpl Core.LexerImpl
TYPE: mixed/null TYPE: mixed/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This parameter determines what lexer implementation can be used. The This parameter determines what lexer implementation can be used. The
valid values are: valid values are:
</p> </p>
<dl> <dl>
<dt><em>null</em></dt> <dt><em>null</em></dt>
<dd> <dd>
Recommended, the lexer implementation will be auto-detected based on Recommended, the lexer implementation will be auto-detected based on
your PHP-version and configuration. your PHP-version and configuration.
</dd> </dd>
<dt><em>string</em> lexer identifier</dt> <dt><em>string</em> lexer identifier</dt>
<dd> <dd>
This is a slim way of manually overridding the implementation. This is a slim way of manually overridding the implementation.
Currently recognized values are: DOMLex (the default PHP5 Currently recognized values are: DOMLex (the default PHP5
implementation) implementation)
and DirectLex (the default PHP4 implementation). Only use this if and DirectLex (the default PHP4 implementation). Only use this if
you know what you are doing: usually, the auto-detection will you know what you are doing: usually, the auto-detection will
manage things for cases you aren't even aware of. manage things for cases you aren't even aware of.
</dd> </dd>
<dt><em>object</em> lexer instance</dt> <dt><em>object</em> lexer instance</dt>
<dd> <dd>
Super-advanced: you can specify your own, custom, implementation that Super-advanced: you can specify your own, custom, implementation that
implements the interface defined by <code>HTMLPurifier_Lexer</code>. implements the interface defined by <code>HTMLPurifier_Lexer</code>.
I may remove this option simply because I don't expect anyone I may remove this option simply because I don't expect anyone
to use it. to use it.
</dd> </dd>
</dl> </dl>

View File

@ -1,16 +1,16 @@
Core.MaintainLineNumbers Core.MaintainLineNumbers
TYPE: bool/null TYPE: bool/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
If true, HTML Purifier will add line number information to all tokens. If true, HTML Purifier will add line number information to all tokens.
This is useful when error reporting is turned on, but can result in This is useful when error reporting is turned on, but can result in
significant performance degradation and should not be used when significant performance degradation and should not be used when
unnecessary. This directive must be used with the DirectLex lexer, unnecessary. This directive must be used with the DirectLex lexer,
as the DOMLex lexer does not (yet) support this functionality. as the DOMLex lexer does not (yet) support this functionality.
If the value is null, an appropriate value will be selected based If the value is null, an appropriate value will be selected based
on other configuration. on other configuration.
</p> </p>

View File

@ -1,12 +1,12 @@
Core.RemoveInvalidImg Core.RemoveInvalidImg
TYPE: bool TYPE: bool
DEFAULT: true DEFAULT: true
VERSION: 1.3.0 VERSION: 1.3.0
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive enables pre-emptive URI checking in <code>img</code> This directive enables pre-emptive URI checking in <code>img</code>
tags, as the attribute validation strategy is not authorized to tags, as the attribute validation strategy is not authorized to
remove elements from the document. Revert to pre-1.3.0 behavior by setting to false. remove elements from the document. Revert to pre-1.3.0 behavior by setting to false.
</p> </p>

View File

@ -1,11 +1,11 @@
Core.RemoveScriptContents Core.RemoveScriptContents
TYPE: bool/null TYPE: bool/null
DEFAULT: NULL DEFAULT: NULL
VERSION: 2.0.0 VERSION: 2.0.0
DEPRECATED-VERSION: 2.1.0 DEPRECATED-VERSION: 2.1.0
DEPRECATED-USE: Core.HiddenElements DEPRECATED-USE: Core.HiddenElements
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive enables HTML Purifier to remove not only script tags This directive enables HTML Purifier to remove not only script tags
but all of their contents. but all of their contents.
</p> </p>

View File

@ -1,2 +1,2 @@
Core Core
DESCRIPTION: Core features that are always available. DESCRIPTION: Core features that are always available.

View File

@ -1,2 +1,2 @@
Filter Filter
DESCRIPTION: Directives for turning filters on and off, or specifying custom filters. DESCRIPTION: Directives for turning filters on and off, or specifying custom filters.

View File

@ -1,14 +1,14 @@
FilterParam.ExtractStyleBlocksEscaping FilterParam.ExtractStyleBlocksEscaping
TYPE: bool TYPE: bool
VERSION: 3.0.0 VERSION: 3.0.0
DEFAULT: true DEFAULT: true
ALIASES: Filter.ExtractStyleBlocksEscaping ALIASES: Filter.ExtractStyleBlocksEscaping
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Whether or not to escape the dangerous characters &lt;, &gt; and &amp; Whether or not to escape the dangerous characters &lt;, &gt; and &amp;
as \3C, \3E and \26, respectively. This is can be safely set to false as \3C, \3E and \26, respectively. This is can be safely set to false
if the contents of StyleBlocks will be placed in an external stylesheet, if the contents of StyleBlocks will be placed in an external stylesheet,
where there is no risk of it being interpreted as HTML. where there is no risk of it being interpreted as HTML.
</p> </p>

View File

@ -1,28 +1,28 @@
FilterParam.ExtractStyleBlocksScope FilterParam.ExtractStyleBlocksScope
TYPE: string/null TYPE: string/null
VERSION: 3.0.0 VERSION: 3.0.0
DEFAULT: NULL DEFAULT: NULL
ALIASES: Filter.ExtractStyleBlocksScope ALIASES: Filter.ExtractStyleBlocksScope
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
If you would like users to be able to define external stylesheets, but If you would like users to be able to define external stylesheets, but
only allow them to specify CSS declarations for a specific node and only allow them to specify CSS declarations for a specific node and
prevent them from fiddling with other elements, use this directive. prevent them from fiddling with other elements, use this directive.
It accepts any valid CSS selector, and will prepend this to any It accepts any valid CSS selector, and will prepend this to any
CSS declaration extracted from the document. For example, if this CSS declaration extracted from the document. For example, if this
directive is set to <code>#user-content</code> and a user uses the directive is set to <code>#user-content</code> and a user uses the
selector <code>a:hover</code>, the final selector will be selector <code>a:hover</code>, the final selector will be
<code>#user-content a:hover</code>. <code>#user-content a:hover</code>.
</p> </p>
<p> <p>
The comma shorthand may be used; consider the above example, with The comma shorthand may be used; consider the above example, with
<code>#user-content, #user-content2</code>, the final selector will <code>#user-content, #user-content2</code>, the final selector will
be <code>#user-content a:hover, #user-content2 a:hover</code>. be <code>#user-content a:hover, #user-content2 a:hover</code>.
</p> </p>
<p> <p>
<strong>Warning:</strong> It is possible for users to bypass this measure <strong>Warning:</strong> It is possible for users to bypass this measure
using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML
Purifier, and I am working to get it fixed. Until then, HTML Purifier Purifier, and I am working to get it fixed. Until then, HTML Purifier
performs a basic check to prevent this. performs a basic check to prevent this.
</p> </p>

View File

@ -1,22 +1,22 @@
HTML.Allowed HTML.Allowed
TYPE: itext/null TYPE: itext/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This is a convenience directive that rolls the functionality of This is a convenience directive that rolls the functionality of
%HTML.AllowedElements and %HTML.AllowedAttributes into one directive. %HTML.AllowedElements and %HTML.AllowedAttributes into one directive.
Specify elements and attributes that are allowed using: Specify elements and attributes that are allowed using:
<code>element1[attr1|attr2],element2...</code>. You can also use <code>element1[attr1|attr2],element2...</code>. You can also use
newlines instead of commas to separate elements. newlines instead of commas to separate elements.
</p> </p>
<p> <p>
<strong>Warning</strong>: <strong>Warning</strong>:
All of the constraints on the component directives are still enforced. All of the constraints on the component directives are still enforced.
The syntax is a <em>subset</em> of TinyMCE's <code>valid_elements</code> The syntax is a <em>subset</em> of TinyMCE's <code>valid_elements</code>
whitelist: directly copy-pasting it here will probably result in whitelist: directly copy-pasting it here will probably result in
broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes
are set, this directive has no effect. are set, this directive has no effect.
</p> </p>

View File

@ -1,19 +1,19 @@
HTML.AllowedAttributes HTML.AllowedAttributes
TYPE: lookup/null TYPE: lookup/null
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
If HTML Purifier's attribute set is unsatisfactory, overload it! If HTML Purifier's attribute set is unsatisfactory, overload it!
The syntax is "tag.attr" or "*.attr" for the global attributes The syntax is "tag.attr" or "*.attr" for the global attributes
(style, id, class, dir, lang, xml:lang). (style, id, class, dir, lang, xml:lang).
</p> </p>
<p> <p>
<strong>Warning:</strong> If another directive conflicts with the <strong>Warning:</strong> If another directive conflicts with the
elements here, <em>that</em> directive will win and override. For elements here, <em>that</em> directive will win and override. For
example, %HTML.EnableAttrID will take precedence over *.id in this example, %HTML.EnableAttrID will take precedence over *.id in this
directive. You must set that directive to true before you can use directive. You must set that directive to true before you can use
IDs at all. IDs at all.
</p> </p>

View File

@ -1,18 +1,18 @@
HTML.AllowedElements HTML.AllowedElements
TYPE: lookup/null TYPE: lookup/null
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
If HTML Purifier's tag set is unsatisfactory for your needs, you If HTML Purifier's tag set is unsatisfactory for your needs, you
can overload it with your own list of tags to allow. Note that this can overload it with your own list of tags to allow. Note that this
method is subtractive: it does its job by taking away from HTML Purifier method is subtractive: it does its job by taking away from HTML Purifier
usual feature set, so you cannot add a tag that HTML Purifier never usual feature set, so you cannot add a tag that HTML Purifier never
supported in the first place (like embed, form or head). If you supported in the first place (like embed, form or head). If you
change this, you probably also want to change %HTML.AllowedAttributes. change this, you probably also want to change %HTML.AllowedAttributes.
</p> </p>
<p> <p>
<strong>Warning:</strong> If another directive conflicts with the <strong>Warning:</strong> If another directive conflicts with the
elements here, <em>that</em> directive will win and override. elements here, <em>that</em> directive will win and override.
</p> </p>

View File

@ -1,20 +1,20 @@
HTML.AllowedModules HTML.AllowedModules
TYPE: lookup/null TYPE: lookup/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
A doctype comes with a set of usual modules to use. Without having A doctype comes with a set of usual modules to use. Without having
to mucking about with the doctypes, you can quickly activate or to mucking about with the doctypes, you can quickly activate or
disable these modules by specifying which modules you wish to allow disable these modules by specifying which modules you wish to allow
with this directive. This is most useful for unit testing specific with this directive. This is most useful for unit testing specific
modules, although end users may find it useful for their own ends. modules, although end users may find it useful for their own ends.
</p> </p>
<p> <p>
If you specify a module that does not exist, the manager will silently If you specify a module that does not exist, the manager will silently
fail to use it, so be careful! User-defined modules are not affected fail to use it, so be careful! User-defined modules are not affected
by this directive. Modules defined in %HTML.CoreModules are not by this directive. Modules defined in %HTML.CoreModules are not
affected by this directive. affected by this directive.
</p> </p>

View File

@ -1,18 +1,18 @@
HTML.BlockWrapper HTML.BlockWrapper
TYPE: string TYPE: string
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: 'p' DEFAULT: 'p'
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
String name of element to wrap inline elements that are inside a block String name of element to wrap inline elements that are inside a block
context. This only occurs in the children of blockquote in strict mode. context. This only occurs in the children of blockquote in strict mode.
</p> </p>
<p> <p>
Example: by default value, Example: by default value,
<code>&lt;blockquote&gt;Foo&lt;/blockquote&gt;</code> would become <code>&lt;blockquote&gt;Foo&lt;/blockquote&gt;</code> would become
<code>&lt;blockquote&gt;&lt;p&gt;Foo&lt;/p&gt;&lt;/blockquote&gt;</code>. <code>&lt;blockquote&gt;&lt;p&gt;Foo&lt;/p&gt;&lt;/blockquote&gt;</code>.
The <code>&lt;p&gt;</code> tags can be replaced with whatever you desire, The <code>&lt;p&gt;</code> tags can be replaced with whatever you desire,
as long as it is a block level element. as long as it is a block level element.
</p> </p>

View File

@ -1,23 +1,23 @@
HTML.CoreModules HTML.CoreModules
TYPE: lookup TYPE: lookup
VERSION: 2.0.0 VERSION: 2.0.0
--DEFAULT-- --DEFAULT--
array ( array (
'Structure' => true, 'Structure' => true,
'Text' => true, 'Text' => true,
'Hypertext' => true, 'Hypertext' => true,
'List' => true, 'List' => true,
'NonXMLCommonAttributes' => true, 'NonXMLCommonAttributes' => true,
'XMLCommonAttributes' => true, 'XMLCommonAttributes' => true,
'CommonAttributes' => true, 'CommonAttributes' => true,
) )
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Certain modularized doctypes (XHTML, namely), have certain modules Certain modularized doctypes (XHTML, namely), have certain modules
that must be included for the doctype to be an conforming document that must be included for the doctype to be an conforming document
type: put those modules here. By default, XHTML's core modules type: put those modules here. By default, XHTML's core modules
are used. You can set this to a blank array to disable core module are used. You can set this to a blank array to disable core module
protection, but this is not recommended. protection, but this is not recommended.
</p> </p>

View File

@ -1,10 +1,10 @@
HTML.CustomDoctype HTML.CustomDoctype
TYPE: string/null TYPE: string/null
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
A custom doctype for power-users who defined there own document A custom doctype for power-users who defined there own document
type. This directive only applies when %HTML.Doctype is blank. type. This directive only applies when %HTML.Doctype is blank.

View File

@ -1,33 +1,33 @@
HTML.DefinitionID HTML.DefinitionID
TYPE: string/null TYPE: string/null
DEFAULT: NULL DEFAULT: NULL
VERSION: 2.0.0 VERSION: 2.0.0
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Unique identifier for a custom-built HTML definition. If you edit Unique identifier for a custom-built HTML definition. If you edit
the raw version of the HTMLDefinition, introducing changes that the the raw version of the HTMLDefinition, introducing changes that the
configuration object does not reflect, you must specify this variable. configuration object does not reflect, you must specify this variable.
If you change your custom edits, you should change this directive, or If you change your custom edits, you should change this directive, or
clear your cache. Example: clear your cache. Example:
</p> </p>
<pre> <pre>
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('HTML', 'DefinitionID', '1'); $config->set('HTML', 'DefinitionID', '1');
$def = $config->getHTMLDefinition(); $def = $config->getHTMLDefinition();
$def->addAttribute('a', 'tabindex', 'Number'); $def->addAttribute('a', 'tabindex', 'Number');
</pre> </pre>
<p> <p>
In the above example, the configuration is still at the defaults, but In the above example, the configuration is still at the defaults, but
using the advanced API, an extra attribute has been added. The using the advanced API, an extra attribute has been added. The
configuration object normally has no way of knowing that this change configuration object normally has no way of knowing that this change
has taken place, so it needs an extra directive: %HTML.DefinitionID. has taken place, so it needs an extra directive: %HTML.DefinitionID.
If someone else attempts to use the default configuration, these two If someone else attempts to use the default configuration, these two
pieces of code will not clobber each other in the cache, since one has pieces of code will not clobber each other in the cache, since one has
an extra directive attached to it. an extra directive attached to it.
</p> </p>
<p> <p>
You <em>must</em> specify a value to this directive to use the You <em>must</em> specify a value to this directive to use the
advanced API features. advanced API features.
</p> </p>

View File

@ -1,16 +1,16 @@
HTML.DefinitionRev HTML.DefinitionRev
TYPE: int TYPE: int
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 1 DEFAULT: 1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Revision identifier for your custom definition specified in Revision identifier for your custom definition specified in
%HTML.DefinitionID. This serves the same purpose: uniquely identifying %HTML.DefinitionID. This serves the same purpose: uniquely identifying
your custom definition, but this one does so in a chronological your custom definition, but this one does so in a chronological
context: revision 3 is more up-to-date then revision 2. Thus, when context: revision 3 is more up-to-date then revision 2. Thus, when
this gets incremented, the cache handling is smart enough to clean this gets incremented, the cache handling is smart enough to clean
up any older revisions of your definition as well as flush the up any older revisions of your definition as well as flush the
cache. cache.
</p> </p>

View File

@ -1,10 +1,10 @@
HTML.Doctype HTML.Doctype
TYPE: string/null TYPE: string/null
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
Doctype to use during filtering. Technically speaking this is not actually Doctype to use during filtering. Technically speaking this is not actually
a doctype (as it does not identify a corresponding DTD), but we are using a doctype (as it does not identify a corresponding DTD), but we are using
this name for sake of simplicity. When non-blank, this will override any this name for sake of simplicity. When non-blank, this will override any
older directives like %HTML.XHTML or %HTML.Strict. older directives like %HTML.XHTML or %HTML.Strict.
--ALLOWED-- --ALLOWED--
'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' 'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1'

View File

@ -1,12 +1,12 @@
HTML.Parent HTML.Parent
TYPE: string TYPE: string
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: 'div' DEFAULT: 'div'
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
String name of element that HTML fragment passed to library will be String name of element that HTML fragment passed to library will be
inserted in. An interesting variation would be using span as the inserted in. An interesting variation would be using span as the
parent element, meaning that only inline tags would be allowed. parent element, meaning that only inline tags would be allowed.
</p> </p>

View File

@ -1,8 +1,8 @@
HTML.Strict HTML.Strict
TYPE: bool TYPE: bool
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: false DEFAULT: false
DEPRECATED-VERSION: 1.7.0 DEPRECATED-VERSION: 1.7.0
DEPRECATED-USE: HTML.Doctype DEPRECATED-USE: HTML.Doctype
--DESCRIPTION-- --DESCRIPTION--
Determines whether or not to use Transitional (loose) or Strict rulesets. Determines whether or not to use Transitional (loose) or Strict rulesets.

View File

@ -1,8 +1,8 @@
HTML.TidyAdd HTML.TidyAdd
TYPE: lookup TYPE: lookup
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
Fixes to add to the default set of Tidy fixes as per your level. Fixes to add to the default set of Tidy fixes as per your level.

View File

@ -1,23 +1,23 @@
HTML.TidyLevel HTML.TidyLevel
TYPE: string TYPE: string
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 'medium' DEFAULT: 'medium'
--DESCRIPTION-- --DESCRIPTION--
<p>General level of cleanliness the Tidy module should enforce. <p>General level of cleanliness the Tidy module should enforce.
There are four allowed values:</p> There are four allowed values:</p>
<dl> <dl>
<dt>none</dt> <dt>none</dt>
<dd>No extra tidying should be done</dd> <dd>No extra tidying should be done</dd>
<dt>light</dt> <dt>light</dt>
<dd>Only fix elements that would be discarded otherwise due to <dd>Only fix elements that would be discarded otherwise due to
lack of support in doctype</dd> lack of support in doctype</dd>
<dt>medium</dt> <dt>medium</dt>
<dd>Enforce best practices</dd> <dd>Enforce best practices</dd>
<dt>heavy</dt> <dt>heavy</dt>
<dd>Transform all deprecated elements and attributes to standards <dd>Transform all deprecated elements and attributes to standards
compliant equivalents</dd> compliant equivalents</dd>
</dl> </dl>
--ALLOWED-- --ALLOWED--
'none', 'light', 'medium', 'heavy' 'none', 'light', 'medium', 'heavy'

View File

@ -1,8 +1,8 @@
HTML.TidyRemove HTML.TidyRemove
TYPE: lookup TYPE: lookup
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
Fixes to remove from the default set of Tidy fixes as per your level. Fixes to remove from the default set of Tidy fixes as per your level.

View File

@ -1,7 +1,7 @@
HTML.Trusted HTML.Trusted
TYPE: bool TYPE: bool
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Indicates whether or not the user input is trusted or not. If the input is Indicates whether or not the user input is trusted or not. If the input is
trusted, a more expansive set of allowed tags and attributes will be used. trusted, a more expansive set of allowed tags and attributes will be used.

View File

@ -1,10 +1,10 @@
HTML.XHTML HTML.XHTML
TYPE: bool TYPE: bool
DEFAULT: true DEFAULT: true
VERSION: 1.1.0 VERSION: 1.1.0
DEPRECATED-VERSION: 1.7.0 DEPRECATED-VERSION: 1.7.0
DEPRECATED-USE: HTML.Doctype DEPRECATED-USE: HTML.Doctype
--DESCRIPTION-- --DESCRIPTION--
Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor.
--ALIASES-- --ALIASES--
Core.XHTML Core.XHTML

View File

@ -1,2 +1,2 @@
HTML HTML
DESCRIPTION: Configuration regarding allowed HTML. DESCRIPTION: Configuration regarding allowed HTML.

View File

@ -1,9 +1,9 @@
Output.CommentScriptContents Output.CommentScriptContents
TYPE: bool TYPE: bool
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: true DEFAULT: true
--DESCRIPTION-- --DESCRIPTION--
Determines whether or not HTML Purifier should attempt to fix up the Determines whether or not HTML Purifier should attempt to fix up the
contents of script tags for legacy browsers with comments. contents of script tags for legacy browsers with comments.
--ALIASES-- --ALIASES--
Core.CommentScriptContents Core.CommentScriptContents

View File

@ -1,13 +1,13 @@
Output.Newline Output.Newline
TYPE: string/null TYPE: string/null
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Newline string to format final output with. If left null, HTML Purifier Newline string to format final output with. If left null, HTML Purifier
will auto-detect the default newline type of the system and use that; will auto-detect the default newline type of the system and use that;
you can manually override it here. Remember, \r\n is Windows, \r you can manually override it here. Remember, \r\n is Windows, \r
is Mac, and \n is Unix. is Mac, and \n is Unix.
</p> </p>

View File

@ -1,24 +1,24 @@
Output.TidyFormat Output.TidyFormat
TYPE: bool TYPE: bool
VERSION: 1.1.1 VERSION: 1.1.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Determines whether or not to run Tidy on the final output for pretty Determines whether or not to run Tidy on the final output for pretty
formatting reasons, such as indentation and wrap. formatting reasons, such as indentation and wrap.
</p> </p>
<p> <p>
This can greatly improve readability for editors who are hand-editing This can greatly improve readability for editors who are hand-editing
the HTML, but is by no means necessary as HTML Purifier has already the HTML, but is by no means necessary as HTML Purifier has already
fixed all major errors the HTML may have had. Tidy is a non-default fixed all major errors the HTML may have had. Tidy is a non-default
extension, and this directive will silently fail if Tidy is not extension, and this directive will silently fail if Tidy is not
available. available.
</p> </p>
<p> <p>
If you are looking to make the overall look of your page's source If you are looking to make the overall look of your page's source
better, I recommend running Tidy on the entire page rather than just better, I recommend running Tidy on the entire page rather than just
user-content (after all, the indentation relative to the containing user-content (after all, the indentation relative to the containing
blocks will be incorrect). blocks will be incorrect).
</p> </p>
--ALIASES-- --ALIASES--
Core.TidyFormat Core.TidyFormat

View File

@ -1,2 +1,2 @@
Output Output
DESCRIPTION: Configuration relating to the generation of (X)HTML. DESCRIPTION: Configuration relating to the generation of (X)HTML.

View File

@ -1,6 +1,6 @@
Test.ForceNoIconv Test.ForceNoIconv
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
When set to true, HTMLPurifier_Encoder will act as if iconv does not exist When set to true, HTMLPurifier_Encoder will act as if iconv does not exist
and use only pure PHP implementations. and use only pure PHP implementations.

View File

@ -1,2 +1,2 @@
Test Test
DESCRIPTION: Developer testing configuration for our unit tests. DESCRIPTION: Developer testing configuration for our unit tests.

View File

@ -1,14 +1,14 @@
URI.AllowedSchemes URI.AllowedSchemes
TYPE: lookup TYPE: lookup
--DEFAULT-- --DEFAULT--
array ( array (
'http' => true, 'http' => true,
'https' => true, 'https' => true,
'mailto' => true, 'mailto' => true,
'ftp' => true, 'ftp' => true,
'nntp' => true, 'nntp' => true,
'news' => true, 'news' => true,
) )
--DESCRIPTION-- --DESCRIPTION--
Whitelist that defines the schemes that a URI is allowed to have. This Whitelist that defines the schemes that a URI is allowed to have. This
prevents XSS attacks from using pseudo-schemes like javascript or mocha. prevents XSS attacks from using pseudo-schemes like javascript or mocha.

View File

@ -1,17 +1,17 @@
URI.Base URI.Base
TYPE: string/null TYPE: string/null
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
The base URI is the URI of the document this purified HTML will be The base URI is the URI of the document this purified HTML will be
inserted into. This information is important if HTML Purifier needs inserted into. This information is important if HTML Purifier needs
to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute
is on. You may use a non-absolute URI for this value, but behavior is on. You may use a non-absolute URI for this value, but behavior
may vary (%URI.MakeAbsolute deals nicely with both absolute and may vary (%URI.MakeAbsolute deals nicely with both absolute and
relative paths, but forwards-compatibility is not guaranteed). relative paths, but forwards-compatibility is not guaranteed).
<strong>Warning:</strong> If set, the scheme on this URI <strong>Warning:</strong> If set, the scheme on this URI
overrides the one specified by %URI.DefaultScheme. overrides the one specified by %URI.DefaultScheme.
</p> </p>

View File

@ -1,10 +1,10 @@
URI.DefaultScheme URI.DefaultScheme
TYPE: string TYPE: string
DEFAULT: 'http' DEFAULT: 'http'
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Defines through what scheme the output will be served, in order to Defines through what scheme the output will be served, in order to
select the proper object validator when no scheme information is present. select the proper object validator when no scheme information is present.
</p> </p>

View File

@ -1,11 +1,11 @@
URI.DefinitionID URI.DefinitionID
TYPE: string/null TYPE: string/null
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Unique identifier for a custom-built URI definition. If you want Unique identifier for a custom-built URI definition. If you want
to add custom URIFilters, you must specify this value. to add custom URIFilters, you must specify this value.
</p> </p>

View File

@ -1,11 +1,11 @@
URI.DefinitionRev URI.DefinitionRev
TYPE: int TYPE: int
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: 1 DEFAULT: 1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Revision identifier for your custom definition. See Revision identifier for your custom definition. See
%HTML.DefinitionRev for details. %HTML.DefinitionRev for details.
</p> </p>

View File

@ -1,13 +1,13 @@
URI.Disable URI.Disable
TYPE: bool TYPE: bool
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Disables all URIs in all forms. Not sure why you'd want to do that Disables all URIs in all forms. Not sure why you'd want to do that
(after all, the Internet's founded on the notion of a hyperlink). (after all, the Internet's founded on the notion of a hyperlink).
</p> </p>
--ALIASES-- --ALIASES--
Attr.DisableURI Attr.DisableURI

View File

@ -1,10 +1,10 @@
URI.DisableExternal URI.DisableExternal
TYPE: bool TYPE: bool
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Disables links to external websites. This is a highly effective anti-spam Disables links to external websites. This is a highly effective anti-spam
and anti-pagerank-leech measure, but comes at a hefty price: nolinks or and anti-pagerank-leech measure, but comes at a hefty price: nolinks or
images outside of your domain will be allowed. Non-linkified URIs will images outside of your domain will be allowed. Non-linkified URIs will
still be preserved. If you want to be able to link to subdomains or use still be preserved. If you want to be able to link to subdomains or use
absolute URIs, specify %URI.Host for your website. absolute URIs, specify %URI.Host for your website.

View File

@ -1,12 +1,12 @@
URI.DisableExternalResources URI.DisableExternalResources
TYPE: bool TYPE: bool
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Disables the embedding of external resources, preventing users from Disables the embedding of external resources, preventing users from
embedding things like images from other hosts. This prevents access embedding things like images from other hosts. This prevents access
tracking (good for email viewers), bandwidth leeching, cross-site request tracking (good for email viewers), bandwidth leeching, cross-site request
forging, goatse.cx posting, and other nasties, but also results in a loss forging, goatse.cx posting, and other nasties, but also results in a loss
of end-user functionality (they can't directly post a pic they posted from of end-user functionality (they can't directly post a pic they posted from
Flickr anymore). Use it if you don't have a robust user-content moderation Flickr anymore). Use it if you don't have a robust user-content moderation
team. team.

View File

@ -1,12 +1,12 @@
URI.DisableResources URI.DisableResources
TYPE: bool TYPE: bool
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Disables embedding resources, essentially meaning no pictures. You can Disables embedding resources, essentially meaning no pictures. You can
still link to them though. See %URI.DisableExternalResources for why still link to them though. See %URI.DisableExternalResources for why
this might be a good idea. this might be a good idea.
</p> </p>

View File

@ -1,19 +1,19 @@
URI.Host URI.Host
TYPE: string/null TYPE: string/null
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Defines the domain name of the server, so we can determine whether or Defines the domain name of the server, so we can determine whether or
an absolute URI is from your website or not. Not strictly necessary, an absolute URI is from your website or not. Not strictly necessary,
as users should be using relative URIs to reference resources on your as users should be using relative URIs to reference resources on your
website. It will, however, let you use absolute URIs to link to website. It will, however, let you use absolute URIs to link to
subdomains of the domain you post here: i.e. example.com will allow subdomains of the domain you post here: i.e. example.com will allow
sub.example.com. However, higher up domains will still be excluded: sub.example.com. However, higher up domains will still be excluded:
if you set %URI.Host to sub.example.com, example.com will be blocked. if you set %URI.Host to sub.example.com, example.com will be blocked.
<strong>Note:</strong> This directive overrides %URI.Base because <strong>Note:</strong> This directive overrides %URI.Base because
a given page may be on a sub-domain, but you wish HTML Purifier to be a given page may be on a sub-domain, but you wish HTML Purifier to be
more relaxed and allow some of the parent domains too. more relaxed and allow some of the parent domains too.
</p> </p>

View File

@ -1,8 +1,8 @@
URI.HostBlacklist URI.HostBlacklist
TYPE: list TYPE: list
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of strings that are forbidden in the host of any URI. Use it to kill List of strings that are forbidden in the host of any URI. Use it to kill
domain names of spam, etc. Note that it will catch anything in the domain, domain names of spam, etc. Note that it will catch anything in the domain,
so <tt>moo.com</tt> will catch <tt>moo.com.example.com</tt>. so <tt>moo.com</tt> will catch <tt>moo.com.example.com</tt>.

View File

@ -1,12 +1,12 @@
URI.MakeAbsolute URI.MakeAbsolute
TYPE: bool TYPE: bool
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Converts all URIs into absolute forms. This is useful when the HTML Converts all URIs into absolute forms. This is useful when the HTML
being filtered assumes a specific base path, but will actually be being filtered assumes a specific base path, but will actually be
viewed in a different context (and setting an alternate base URI is viewed in a different context (and setting an alternate base URI is
not possible). %URI.Base must be set for this directive to work. not possible). %URI.Base must be set for this directive to work.
</p> </p>

View File

@ -1,82 +1,82 @@
URI.Munge URI.Munge
TYPE: string/null TYPE: string/null
VERSION: 1.3.0 VERSION: 1.3.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Munges all browsable (usually http, https and ftp) Munges all browsable (usually http, https and ftp)
absolute URIs into another URI, usually a URI redirection service. absolute URIs into another URI, usually a URI redirection service.
This directive accepts a URI, formatted with a <code>%s</code> where This directive accepts a URI, formatted with a <code>%s</code> where
the url-encoded original URI should be inserted (sample: the url-encoded original URI should be inserted (sample:
<code>http://www.google.com/url?q=%s</code>). <code>http://www.google.com/url?q=%s</code>).
</p> </p>
<p> <p>
Uses for this directive: Uses for this directive:
</p> </p>
<ul> <ul>
<li> <li>
Prevent PageRank leaks, while being fairly transparent Prevent PageRank leaks, while being fairly transparent
to users (you may also want to add some client side JavaScript to to users (you may also want to add some client side JavaScript to
override the text in the statusbar). <strong>Notice</strong>: override the text in the statusbar). <strong>Notice</strong>:
Many security experts believe that this form of protection does not deter spam-bots. Many security experts believe that this form of protection does not deter spam-bots.
</li> </li>
<li> <li>
Redirect users to a splash page telling them they are leaving your Redirect users to a splash page telling them they are leaving your
website. While this is poor usability practice, it is often mandated website. While this is poor usability practice, it is often mandated
in corporate environments. in corporate environments.
</li> </li>
</ul> </ul>
<p> <p>
Prior to HTML Purifier 3.1.1, this directive also enabled the munging Prior to HTML Purifier 3.1.1, this directive also enabled the munging
of browsable external resources, which could break things if your redirection of browsable external resources, which could break things if your redirection
script was a splash page or used <code>meta</code> tags. To revert to script was a splash page or used <code>meta</code> tags. To revert to
previous behavior, please use %URI.MungeResources. previous behavior, please use %URI.MungeResources.
</p> </p>
<p> <p>
You may want to also use %URI.MungeSecretKey along with this directive You may want to also use %URI.MungeSecretKey along with this directive
in order to enforce what URIs your redirector script allows. Open in order to enforce what URIs your redirector script allows. Open
redirector scripts can be a security risk and negatively affect the redirector scripts can be a security risk and negatively affect the
reputation of your domain name. reputation of your domain name.
</p> </p>
<p> <p>
Starting with HTML Purifier 3.1.1, there is also these substitutions: Starting with HTML Purifier 3.1.1, there is also these substitutions:
</p> </p>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Key</th> <th>Key</th>
<th>Description</th> <th>Description</th>
<th>Example <code>&lt;a href=""&gt;</code></th> <th>Example <code>&lt;a href=""&gt;</code></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>%r</td> <td>%r</td>
<td>1 - The URI embeds a resource<br />(blank) - The URI is merely a link</td> <td>1 - The URI embeds a resource<br />(blank) - The URI is merely a link</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>%n</td> <td>%n</td>
<td>The name of the tag this URI came from</td> <td>The name of the tag this URI came from</td>
<td>a</td> <td>a</td>
</tr> </tr>
<tr> <tr>
<td>%m</td> <td>%m</td>
<td>The name of the attribute this URI came from</td> <td>The name of the attribute this URI came from</td>
<td>href</td> <td>href</td>
</tr> </tr>
<tr> <tr>
<td>%p</td> <td>%p</td>
<td>The name of the CSS property this URI came from, or blank if irrelevant</td> <td>The name of the CSS property this URI came from, or blank if irrelevant</td>
<td></td> <td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p> <p>
Admittedly, these letters are somewhat arbitrary; the only stipulation Admittedly, these letters are somewhat arbitrary; the only stipulation
was that they couldn't be a through f. r is for resource (I would have preferred was that they couldn't be a through f. r is for resource (I would have preferred
e, but you take what you can get), n is for name, m e, but you take what you can get), n is for name, m
was picked because it came after n (and I couldn't use a), p is for was picked because it came after n (and I couldn't use a), p is for
property. property.
</p> </p>

View File

@ -1,8 +1,8 @@
URI.OverrideAllowedSchemes URI.OverrideAllowedSchemes
TYPE: bool TYPE: bool
DEFAULT: true DEFAULT: true
--DESCRIPTION-- --DESCRIPTION--
If this is set to true (which it is by default), you can override If this is set to true (which it is by default), you can override
%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the %URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the
registry. If false, you will also have to update that directive in order registry. If false, you will also have to update that directive in order
to add more schemes. to add more schemes.

View File

@ -1,2 +1,2 @@
URI URI
DESCRIPTION: Features regarding Uniform Resource Identifiers. DESCRIPTION: Features regarding Uniform Resource Identifiers.

View File

@ -1,46 +1,46 @@
<?php <?php
require_once 'HTMLPurifier/DefinitionCache/Decorator.php'; require_once 'HTMLPurifier/DefinitionCache/Decorator.php';
/** /**
* Definition cache decorator template. * Definition cache decorator template.
*/ */
class HTMLPurifier_DefinitionCache_Decorator_Template extends class HTMLPurifier_DefinitionCache_Decorator_Template extends
HTMLPurifier_DefinitionCache_Decorator HTMLPurifier_DefinitionCache_Decorator
{ {
var $name = 'Template'; // replace this var $name = 'Template'; // replace this
function copy() { function copy() {
// replace class name with yours // replace class name with yours
return new HTMLPurifier_DefinitionCache_Decorator_Template(); return new HTMLPurifier_DefinitionCache_Decorator_Template();
} }
// remove methods you don't need // remove methods you don't need
function add($def, $config) { function add($def, $config) {
return parent::add($def, $config); return parent::add($def, $config);
} }
function set($def, $config) { function set($def, $config) {
return parent::set($def, $config); return parent::set($def, $config);
} }
function replace($def, $config) { function replace($def, $config) {
return parent::replace($def, $config); return parent::replace($def, $config);
} }
function get($config) { function get($config) {
return parent::get($config); return parent::get($config);
} }
function flush() { function flush() {
return parent::flush(); return parent::flush();
} }
function cleanup($config) { function cleanup($config) {
return parent::cleanup($config); return parent::cleanup($config);
} }
} }

View File

@ -1,46 +1,46 @@
<?php <?php
/** /**
* XHTML 1.1 Object Module, defines elements for generic object inclusion * XHTML 1.1 Object Module, defines elements for generic object inclusion
* @warning Users will commonly use <embed> to cater to legacy browsers: this * @warning Users will commonly use <embed> to cater to legacy browsers: this
* module does not allow this sort of behavior * module does not allow this sort of behavior
*/ */
class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule
{ {
public $name = 'Object'; public $name = 'Object';
public $safe = false; public $safe = false;
public function setup($config) { public function setup($config) {
$this->addElement('object', 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', $this->addElement('object', 'Inline', 'Optional: #PCDATA | Flow | param', 'Common',
array( array(
'archive' => 'URI', 'archive' => 'URI',
'classid' => 'URI', 'classid' => 'URI',
'codebase' => 'URI', 'codebase' => 'URI',
'codetype' => 'Text', 'codetype' => 'Text',
'data' => 'URI', 'data' => 'URI',
'declare' => 'Bool#declare', 'declare' => 'Bool#declare',
'height' => 'Length', 'height' => 'Length',
'name' => 'CDATA', 'name' => 'CDATA',
'standby' => 'Text', 'standby' => 'Text',
'tabindex' => 'Number', 'tabindex' => 'Number',
'type' => 'ContentType', 'type' => 'ContentType',
'width' => 'Length' 'width' => 'Length'
) )
); );
$this->addElement('param', false, 'Empty', false, $this->addElement('param', false, 'Empty', false,
array( array(
'id' => 'ID', 'id' => 'ID',
'name*' => 'Text', 'name*' => 'Text',
'type' => 'Text', 'type' => 'Text',
'value' => 'Text', 'value' => 'Text',
'valuetype' => 'Enum#data,ref,object' 'valuetype' => 'Enum#data,ref,object'
) )
); );
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,102 +1,102 @@
--- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2007-11-05 00:01:51.643585000 -0500 --- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2007-11-05 00:01:51.643585000 -0500
+++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2008-04-05 00:26:39.343160000 -0400 +++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2008-04-05 00:26:39.343160000 -0400
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
public function __construct($data) { public function __construct($data) {
$data = str_replace("\r\n", "\n", $data); $data = str_replace("\r\n", "\n", $data);
- $date = str_replace("\r", null, $data); - $date = str_replace("\r", null, $data);
+ $data = str_replace("\r", null, $data); + $data = str_replace("\r", null, $data);
$this->data = $data; $this->data = $data;
$this->char = -1; $this->char = -1;
@@ -211,7 +211,10 @@ @@ -211,7 +211,10 @@
// If nothing is returned, emit a U+0026 AMPERSAND character token. // If nothing is returned, emit a U+0026 AMPERSAND character token.
// Otherwise, emit the character token that was returned. // Otherwise, emit the character token that was returned.
$char = (!$entity) ? '&' : $entity; $char = (!$entity) ? '&' : $entity;
- $this->emitToken($char); - $this->emitToken($char);
+ $this->emitToken(array( + $this->emitToken(array(
+ 'type' => self::CHARACTR, + 'type' => self::CHARACTR,
+ 'data' => $char + 'data' => $char
+ )); + ));
// Finally, switch to the data state. // Finally, switch to the data state.
$this->state = 'data'; $this->state = 'data';
@@ -708,7 +711,7 @@ @@ -708,7 +711,7 @@
} elseif($char === '&') { } elseif($char === '&') {
/* U+0026 AMPERSAND (&) /* U+0026 AMPERSAND (&)
Switch to the entity in attribute value state. */ Switch to the entity in attribute value state. */
- $this->entityInAttributeValueState('non'); - $this->entityInAttributeValueState('non');
+ $this->entityInAttributeValueState(); + $this->entityInAttributeValueState();
} elseif($char === '>') { } elseif($char === '>') {
/* U+003E GREATER-THAN SIGN (>) /* U+003E GREATER-THAN SIGN (>)
@@ -738,7 +741,8 @@ @@ -738,7 +741,8 @@
? '&' ? '&'
: $entity; : $entity;
- $this->emitToken($char); - $this->emitToken($char);
+ $last = count($this->token['attr']) - 1; + $last = count($this->token['attr']) - 1;
+ $this->token['attr'][$last]['value'] .= $char; + $this->token['attr'][$last]['value'] .= $char;
} }
private function bogusCommentState() { private function bogusCommentState() {
@@ -1066,6 +1070,11 @@ @@ -1066,6 +1070,11 @@
$this->char++; $this->char++;
if(in_array($id, $this->entities)) { if(in_array($id, $this->entities)) {
+ if ($e_name[$c-1] !== ';') { + if ($e_name[$c-1] !== ';') {
+ if ($c < $len && $e_name[$c] == ';') { + if ($c < $len && $e_name[$c] == ';') {
+ $this->char++; // consume extra semicolon + $this->char++; // consume extra semicolon
+ } + }
+ } + }
$entity = $id; $entity = $id;
break; break;
} }
@@ -2084,7 +2093,7 @@ @@ -2084,7 +2093,7 @@
/* Reconstruct the active formatting elements, if any. */ /* Reconstruct the active formatting elements, if any. */
$this->reconstructActiveFormattingElements(); $this->reconstructActiveFormattingElements();
- $this->insertElement($token); - $this->insertElement($token);
+ $this->insertElement($token, true, true); + $this->insertElement($token, true, true);
break; break;
} }
break; break;
@@ -3465,7 +3474,18 @@ @@ -3465,7 +3474,18 @@
} }
} }
- private function insertElement($token, $append = true) { - private function insertElement($token, $append = true) {
+ private function insertElement($token, $append = true, $check = false) { + private function insertElement($token, $append = true, $check = false) {
+ // Proprietary workaround for libxml2's limitations with tag names + // Proprietary workaround for libxml2's limitations with tag names
+ if ($check) { + if ($check) {
+ // Slightly modified HTML5 tag-name modification, + // Slightly modified HTML5 tag-name modification,
+ // removing anything that's not an ASCII letter, digit, or hyphen + // removing anything that's not an ASCII letter, digit, or hyphen
+ $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); + $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']);
+ // Remove leading hyphens and numbers + // Remove leading hyphens and numbers
+ $token['name'] = ltrim($token['name'], '-0..9'); + $token['name'] = ltrim($token['name'], '-0..9');
+ // In theory, this should ever be needed, but just in case + // In theory, this should ever be needed, but just in case
+ if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice + if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice
+ } + }
+ +
$el = $this->dom->createElement($token['name']); $el = $this->dom->createElement($token['name']);
foreach($token['attr'] as $attr) { foreach($token['attr'] as $attr) {
@@ -3659,7 +3679,7 @@ @@ -3659,7 +3679,7 @@
} }
} }
- private function generateImpliedEndTags(array $exclude = array()) { - private function generateImpliedEndTags(array $exclude = array()) {
+ private function generateImpliedEndTags($exclude = array()) { + private function generateImpliedEndTags($exclude = array()) {
/* When the steps below require the UA to generate implied end tags, /* When the steps below require the UA to generate implied end tags,
then, if the current node is a dd element, a dt element, an li element, then, if the current node is a dd element, a dt element, an li element,
a p element, a td element, a th element, or a tr element, the UA must a p element, a td element, a th element, or a tr element, the UA must
@@ -3673,7 +3693,8 @@ @@ -3673,7 +3693,8 @@
} }
} }
- private function getElementCategory($name) { - private function getElementCategory($name) {
+ private function getElementCategory($node) { + private function getElementCategory($node) {
+ $name = $node->tagName; + $name = $node->tagName;
if(in_array($name, $this->special)) if(in_array($name, $this->special))
return self::SPECIAL; return self::SPECIAL;

View File

@ -1,8 +1,8 @@
Index: src/PHPT/Case.php Index: src/PHPT/Case.php
=================================================================== ===================================================================
--- src/PHPT/Case.php (revision 691) --- src/PHPT/Case.php (revision 691)
+++ src/PHPT/Case.php (working copy) +++ src/PHPT/Case.php (working copy)
@@ -28,17 +28,14 @@ @@ -28,17 +28,14 @@
{ {
$reporter->onCaseStart($this); $reporter->onCaseStart($this);
try { try {
@ -26,7 +26,7 @@ Index: src/PHPT/Case.php
} }
$reporter->onCasePass($this); $reporter->onCasePass($this);
} catch (PHPT_Case_VetoException $veto) { } catch (PHPT_Case_VetoException $veto) {
@@ -46,7 +43,6 @@ @@ -46,7 +43,6 @@
} catch (PHPT_Case_FailureException $failure) { } catch (PHPT_Case_FailureException $failure) {
$reporter->onCaseFail($this, $failure); $reporter->onCaseFail($this, $failure);
} }
@ -34,11 +34,11 @@ Index: src/PHPT/Case.php
$reporter->onCaseEnd($this); $reporter->onCaseEnd($this);
} }
Index: src/PHPT/Case/Validator/CgiRequired.php Index: src/PHPT/Case/Validator/CgiRequired.php
=================================================================== ===================================================================
--- src/PHPT/Case/Validator/CgiRequired.php (revision 691) --- src/PHPT/Case/Validator/CgiRequired.php (revision 691)
+++ src/PHPT/Case/Validator/CgiRequired.php (working copy) +++ src/PHPT/Case/Validator/CgiRequired.php (working copy)
@@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
public function is(PHPT_Case $case) public function is(PHPT_Case $case)
{ {
$return = $case->sections->filterByInterface('CgiExecutable')->valid(); $return = $case->sections->filterByInterface('CgiExecutable')->valid();
@ -46,11 +46,11 @@ Index: src/PHPT/Case/Validator/CgiRequired.php
return $return; return $return;
} }
} }
Index: src/PHPT/CodeRunner/CommandLine.php Index: src/PHPT/CodeRunner/CommandLine.php
=================================================================== ===================================================================
--- src/PHPT/CodeRunner/CommandLine.php (revision 691) --- src/PHPT/CodeRunner/CommandLine.php (revision 691)
+++ src/PHPT/CodeRunner/CommandLine.php (working copy) +++ src/PHPT/CodeRunner/CommandLine.php (working copy)
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
$this->_filename = $runner->filename; $this->_filename = $runner->filename;
$this->_ini = (string)$runner->ini; $this->_ini = (string)$runner->ini;
$this->_args = (string)$runner->args; $this->_args = (string)$runner->args;
@ -59,45 +59,45 @@ Index: src/PHPT/CodeRunner/CommandLine.php
$this->_post_filename = (string)$runner->post_filename; $this->_post_filename = (string)$runner->post_filename;
} }
Index: src/PHPT/CodeRunner/Driver/WScriptShell.php Index: src/PHPT/CodeRunner/Driver/WScriptShell.php
=================================================================== ===================================================================
--- src/PHPT/CodeRunner/Driver/WScriptShell.php (revision 691) --- src/PHPT/CodeRunner/Driver/WScriptShell.php (revision 691)
+++ src/PHPT/CodeRunner/Driver/WScriptShell.php (working copy) +++ src/PHPT/CodeRunner/Driver/WScriptShell.php (working copy)
@@ -23,9 +23,9 @@ @@ -23,9 +23,9 @@
} }
} }
if ($found == false) { if ($found == false) {
- throw new PHPT_CodeRunner_InvalidExecutableException( - throw new PHPT_CodeRunner_InvalidExecutableException(
- 'unable to locate PHP executable: ' . $this->executable - 'unable to locate PHP executable: ' . $this->executable
- ); - );
+ //throw new PHPT_CodeRunner_InvalidExecutableException( + //throw new PHPT_CodeRunner_InvalidExecutableException(
+ // 'unable to locate PHP executable: ' . $this->executable + // 'unable to locate PHP executable: ' . $this->executable
+ //); + //);
} }
} }
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
$error = $this->_process->StdErr->ReadAll(); $error = $this->_process->StdErr->ReadAll();
if (!empty($error)) { if (!empty($error)) {
- throw new PHPT_CodeRunner_ExecutionException($error); - throw new PHPT_CodeRunner_ExecutionException($error);
+ throw new PHPT_CodeRunner_ExecutionException($error, $this->_commandFactory()); + throw new PHPT_CodeRunner_ExecutionException($error, $this->_commandFactory());
} }
return $this->_process->StdOut->ReadAll(); return $this->_process->StdOut->ReadAll();
@@ -93,6 +93,7 @@ @@ -93,6 +93,7 @@
{ {
$return = ''; $return = '';
foreach ($this->environment as $key => $value) { foreach ($this->environment as $key => $value) {
+ $value = str_replace('&', '^&', $value); + $value = str_replace('&', '^&', $value);
$return .= "set {$key}={$value} & "; $return .= "set {$key}={$value} & ";
} }
return $return; return $return;
Index: src/PHPT/CodeRunner/Factory.php Index: src/PHPT/CodeRunner/Factory.php
=================================================================== ===================================================================
--- src/PHPT/CodeRunner/Factory.php (revision 691) --- src/PHPT/CodeRunner/Factory.php (revision 691)
+++ src/PHPT/CodeRunner/Factory.php (working copy) +++ src/PHPT/CodeRunner/Factory.php (working copy)
@@ -33,7 +33,13 @@ @@ -33,7 +33,13 @@
'php-cgi'; 'php-cgi';
} }
@ -112,11 +112,11 @@ Index: src/PHPT/CodeRunner/Factory.php
$runner->executable = $runner->executable . '.exe'; $runner->executable = $runner->executable . '.exe';
} }
try { try {
Index: src/PHPT/Section/ModifiableAbstract.php Index: src/PHPT/Section/ModifiableAbstract.php
=================================================================== ===================================================================
--- src/PHPT/Section/ModifiableAbstract.php (revision 691) --- src/PHPT/Section/ModifiableAbstract.php (revision 691)
+++ src/PHPT/Section/ModifiableAbstract.php (working copy) +++ src/PHPT/Section/ModifiableAbstract.php (working copy)
@@ -15,12 +15,10 @@ @@ -15,12 +15,10 @@
public function run(PHPT_Case $case) public function run(PHPT_Case $case)
{ {
@ -133,11 +133,11 @@ Index: src/PHPT/Section/ModifiableAbstract.php
} }
} }
Index: src/PHPT/Section/SKIPIF.php Index: src/PHPT/Section/SKIPIF.php
=================================================================== ===================================================================
--- src/PHPT/Section/SKIPIF.php (revision 691) --- src/PHPT/Section/SKIPIF.php (revision 691)
+++ src/PHPT/Section/SKIPIF.php (working copy) +++ src/PHPT/Section/SKIPIF.php (working copy)
@@ -3,10 +3,12 @@ @@ -3,10 +3,12 @@
class PHPT_Section_SKIPIF implements PHPT_Section_RunnableBefore class PHPT_Section_SKIPIF implements PHPT_Section_RunnableBefore
{ {
private $_data = null; private $_data = null;
@ -150,7 +150,7 @@ Index: src/PHPT/Section/SKIPIF.php
} }
public function run(PHPT_Case $case) public function run(PHPT_Case $case)
@@ -16,9 +18,7 @@ @@ -16,9 +18,7 @@
// @todo refactor to PHPT_CodeRunner // @todo refactor to PHPT_CodeRunner
file_put_contents($filename, $this->_data); file_put_contents($filename, $this->_data);
@ -161,11 +161,11 @@ Index: src/PHPT/Section/SKIPIF.php
unlink($filename); unlink($filename);
if (preg_match('/^skip( - (.*))?/', $response, $matches)) { if (preg_match('/^skip( - (.*))?/', $response, $matches)) {
Index: src/PHPT/SectionList.php Index: src/PHPT/SectionList.php
=================================================================== ===================================================================
--- src/PHPT/SectionList.php (revision 691) --- src/PHPT/SectionList.php (revision 691)
+++ src/PHPT/SectionList.php (working copy) +++ src/PHPT/SectionList.php (working copy)
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
class PHPT_SectionList implements Iterator class PHPT_SectionList implements Iterator
{ {
@ -173,7 +173,7 @@ Index: src/PHPT/SectionList.php
private $_sections = array(); private $_sections = array();
private $_section_map = array(); private $_section_map = array();
private $_key_map = array(); private $_key_map = array();
@@ -15,14 +14,12 @@ @@ -15,14 +14,12 @@
} }
$name = strtoupper(str_replace('PHPT_Section_', '', get_class($section))); $name = strtoupper(str_replace('PHPT_Section_', '', get_class($section)));
$key = $section instanceof PHPT_Section_Runnable ? $section->getPriority() . '.' . $name : $name; $key = $section instanceof PHPT_Section_Runnable ? $section->getPriority() . '.' . $name : $name;
@ -190,7 +190,7 @@ Index: src/PHPT/SectionList.php
} }
public function current() public function current()
@@ -52,21 +49,23 @@ @@ -52,21 +49,23 @@
public function filterByInterface($interface = null) public function filterByInterface($interface = null)
{ {
@ -220,7 +220,7 @@ Index: src/PHPT/SectionList.php
} }
public function has($name) public function has($name)
@@ -74,11 +73,11 @@ @@ -74,11 +73,11 @@
if (!isset($this->_section_map[$name])) { if (!isset($this->_section_map[$name])) {
return false; return false;
} }
@ -234,11 +234,11 @@ Index: src/PHPT/SectionList.php
+ return $this->_sections[$this->_section_map[$key]]; + return $this->_sections[$this->_section_map[$key]];
} }
} }
Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt
=================================================================== ===================================================================
--- tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (revision 691) --- tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (revision 691)
+++ tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (working copy) +++ tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (working copy)
@@ -17,9 +17,9 @@ @@ -17,9 +17,9 @@
// sanity check // sanity check
$obj = new FoobarIni(); $obj = new FoobarIni();
@ -250,11 +250,11 @@ Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt
unset($obj); unset($obj);
Index: tests/Section/File/restores-case-sections.phpt Index: tests/Section/File/restores-case-sections.phpt
=================================================================== ===================================================================
--- tests/Section/File/restores-case-sections.phpt (revision 691) --- tests/Section/File/restores-case-sections.phpt (revision 691)
+++ tests/Section/File/restores-case-sections.phpt (working copy) +++ tests/Section/File/restores-case-sections.phpt (working copy)
@@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
---TEST-- ---TEST--
-After PHPT_Section_FILE::run(), the sections property of the provide $case object -After PHPT_Section_FILE::run(), the sections property of the provide $case object
-is restored to its unfiltered state -is restored to its unfiltered state
@ -279,11 +279,11 @@ Index: tests/Section/File/restores-case-sections.phpt
-===DONE=== -===DONE===
---EXPECT-- ---EXPECT--
-===DONE=== -===DONE===
Index: tests/SectionList/filter-by-interface.phpt Index: tests/SectionList/filter-by-interface.phpt
=================================================================== ===================================================================
--- tests/SectionList/filter-by-interface.phpt (revision 691) --- tests/SectionList/filter-by-interface.phpt (revision 691)
+++ tests/SectionList/filter-by-interface.phpt (working copy) +++ tests/SectionList/filter-by-interface.phpt (working copy)
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
$data = array_merge($runnable, $non_runnable); $data = array_merge($runnable, $non_runnable);
$list = new PHPT_SectionList($data); $list = new PHPT_SectionList($data);
@ -298,11 +298,11 @@ Index: tests/SectionList/filter-by-interface.phpt
?> ?>
===DONE=== ===DONE===
Index: tests/SectionList/filter-resets-with-null.phpt Index: tests/SectionList/filter-resets-with-null.phpt
=================================================================== ===================================================================
--- tests/SectionList/filter-resets-with-null.phpt (revision 691) --- tests/SectionList/filter-resets-with-null.phpt (revision 691)
+++ tests/SectionList/filter-resets-with-null.phpt (working copy) +++ tests/SectionList/filter-resets-with-null.phpt (working copy)
@@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
---TEST-- ---TEST--
-If you call filterByInterface() with null or no-value, the full dataset is restored -If you call filterByInterface() with null or no-value, the full dataset is restored
---FILE-- ---FILE--
@ -339,11 +339,11 @@ Index: tests/SectionList/filter-resets-with-null.phpt
-===DONE=== -===DONE===
---EXPECT-- ---EXPECT--
-===DONE=== -===DONE===
Index: tests/Util/Code/runAsFile-executes-in-file.phpt Index: tests/Util/Code/runAsFile-executes-in-file.phpt
=================================================================== ===================================================================
--- tests/Util/Code/runAsFile-executes-in-file.phpt (revision 691) --- tests/Util/Code/runAsFile-executes-in-file.phpt (revision 691)
+++ tests/Util/Code/runAsFile-executes-in-file.phpt (working copy) +++ tests/Util/Code/runAsFile-executes-in-file.phpt (working copy)
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
$util = new PHPT_Util_Code($code); $util = new PHPT_Util_Code($code);
@ -352,11 +352,11 @@ Index: tests/Util/Code/runAsFile-executes-in-file.phpt
$result = $util->runAsFile($file); $result = $util->runAsFile($file);
assert('$result == $file'); assert('$result == $file');
Index: tests/Util/Code/runAsFile-returns-output-if-no-return.phpt Index: tests/Util/Code/runAsFile-returns-output-if-no-return.phpt
=================================================================== ===================================================================
--- tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (revision 691) --- tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (revision 691)
+++ tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (working copy) +++ tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (working copy)
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
$util = new PHPT_Util_Code($code); $util = new PHPT_Util_Code($code);

View File

@ -1,24 +1,24 @@
Changelog HTMLPurifier : Phorum Mod Changelog HTMLPurifier : Phorum Mod
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
= KEY ==================== = KEY ====================
# Breaks back-compat # Breaks back-compat
! Feature ! Feature
- Bugfix - Bugfix
+ Sub-comment + Sub-comment
. Internal change . Internal change
========================== ==========================
Version 3.0.0.1 for Phorum 5.2, unknown release date Version 3.0.0.1 for Phorum 5.2, unknown release date
! Better installation documentation ! Better installation documentation
- Fixed double encoded quotes - Fixed double encoded quotes
- Fixed fatal error when migrate.php is blank - Fixed fatal error when migrate.php is blank
Version 3.0.0 for Phorum 5.2, released January 12, 2008 Version 3.0.0 for Phorum 5.2, released January 12, 2008
# WYSIWYG and suppress_message options are now configurable via web # WYSIWYG and suppress_message options are now configurable via web
interface. interface.
- Module now compatible with Phorum 5.2, primary bugs were in migration - Module now compatible with Phorum 5.2, primary bugs were in migration
code as well as signature and edit message handling. This module is NOT code as well as signature and edit message handling. This module is NOT
compatible with Phorum 5.1. compatible with Phorum 5.1.
- Buggy WYSIWYG mode refined - Buggy WYSIWYG mode refined
. AutoFormatParam added to list of default configuration namespaces . AutoFormatParam added to list of default configuration namespaces

View File

@ -1,37 +1,37 @@
<?php <?php
class HTMLPurifier_HTMLModule_ObjectTest extends HTMLPurifier_HTMLModuleHarness class HTMLPurifier_HTMLModule_ObjectTest extends HTMLPurifier_HTMLModuleHarness
{ {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->config->set('HTML', 'Trusted', true); $this->config->set('HTML', 'Trusted', true);
} }
function testDefaultRemoval() { function testDefaultRemoval() {
$this->config->set('HTML', 'Trusted', false); $this->config->set('HTML', 'Trusted', false);
$this->assertResult( $this->assertResult(
'<object></object>', '' '<object></object>', ''
); );
} }
function testMinimal() { function testMinimal() {
$this->assertResult('<object></object>'); $this->assertResult('<object></object>');
} }
function testStandardUseCase() { function testStandardUseCase() {
$this->assertResult( $this->assertResult(
'<object type="video/x-ms-wmv" data="http://domain.com/video.wmv" width="320" height="256"> '<object type="video/x-ms-wmv" data="http://domain.com/video.wmv" width="320" height="256">
<param name="src" value="http://domain.com/video.wmv" /> <param name="src" value="http://domain.com/video.wmv" />
<param name="autostart" value="false" /> <param name="autostart" value="false" />
<param name="controller" value="true" /> <param name="controller" value="true" />
<param name="pluginurl" value="http://www.microsoft.com/Windows/MediaPlayer/" /> <param name="pluginurl" value="http://www.microsoft.com/Windows/MediaPlayer/" />
<a href="http://www.microsoft.com/Windows/MediaPlayer/">Windows Media player required</a> <a href="http://www.microsoft.com/Windows/MediaPlayer/">Windows Media player required</a>
</object>' </object>'
); );
} }
// more test-cases? // more test-cases?
} }

View File

@ -1,12 +1,12 @@
--TEST-- --TEST--
HTMLPurifier.safe-includes.php loading test HTMLPurifier.safe-includes.php loading test
--FILE-- --FILE--
<?php <?php
require_once '../library/HTMLPurifier.php'; // Tests for require_once require_once '../library/HTMLPurifier.php'; // Tests for require_once
require_once '../library/HTMLPurifier.safe-includes.php'; require_once '../library/HTMLPurifier.safe-includes.php';
require 'HTMLPurifier/PHPT/loading/_no-autoload.inc'; require 'HTMLPurifier/PHPT/loading/_no-autoload.inc';
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$purifier = new HTMLPurifier($config); $purifier = new HTMLPurifier($config);
echo $purifier->purify('<b>Salsa!'); echo $purifier->purify('<b>Salsa!');
--EXPECT-- --EXPECT--
<b>Salsa!</b> <b>Salsa!</b>

View File

@ -1,95 +1,95 @@
<?php <?php
class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_StrategyHarness class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_StrategyHarness
{ {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed();
$this->config->set('AutoFormat', 'AutoParagraph', true); $this->config->set('AutoFormat', 'AutoParagraph', true);
$this->config->set('AutoFormat', 'Linkify', true); $this->config->set('AutoFormat', 'Linkify', true);
generate_mock_once('HTMLPurifier_Injector'); generate_mock_once('HTMLPurifier_Injector');
} }
function testEndNotification() { function testEndNotification() {
$mock = new HTMLPurifier_InjectorMock(); $mock = new HTMLPurifier_InjectorMock();
$mock->skip = false; $mock->skip = false;
$mock->expectAt(0, 'notifyEnd', array(new HTMLPurifier_Token_End('b'))); $mock->expectAt(0, 'notifyEnd', array(new HTMLPurifier_Token_End('b')));
$mock->expectAt(1, 'notifyEnd', array(new HTMLPurifier_Token_End('i'))); $mock->expectAt(1, 'notifyEnd', array(new HTMLPurifier_Token_End('i')));
$mock->expectCallCount('notifyEnd', 2); $mock->expectCallCount('notifyEnd', 2);
$this->config->set('AutoFormat', 'AutoParagraph', false); $this->config->set('AutoFormat', 'AutoParagraph', false);
$this->config->set('AutoFormat', 'Linkify', false); $this->config->set('AutoFormat', 'Linkify', false);
$this->config->set('AutoFormat', 'Custom', array($mock)); $this->config->set('AutoFormat', 'Custom', array($mock));
$this->assertResult('<i><b>asdf</b>', '<i><b>asdf</b></i>'); $this->assertResult('<i><b>asdf</b>', '<i><b>asdf</b></i>');
} }
function testErrorRequiredElementNotAllowed() { function testErrorRequiredElementNotAllowed() {
$this->config->set('HTML', 'Allowed', ''); $this->config->set('HTML', 'Allowed', '');
$this->expectError('Cannot enable AutoParagraph injector because p is not allowed'); $this->expectError('Cannot enable AutoParagraph injector because p is not allowed');
$this->expectError('Cannot enable Linkify injector because a is not allowed'); $this->expectError('Cannot enable Linkify injector because a is not allowed');
$this->assertResult('Foobar'); $this->assertResult('Foobar');
} }
function testErrorRequiredAttributeNotAllowed() { function testErrorRequiredAttributeNotAllowed() {
$this->config->set('HTML', 'Allowed', 'a,p'); $this->config->set('HTML', 'Allowed', 'a,p');
$this->expectError('Cannot enable Linkify injector because a.href is not allowed'); $this->expectError('Cannot enable Linkify injector because a.href is not allowed');
$this->assertResult('<p>http://example.com</p>'); $this->assertResult('<p>http://example.com</p>');
} }
function testOnlyAutoParagraph() { function testOnlyAutoParagraph() {
$this->assertResult( $this->assertResult(
'Foobar', 'Foobar',
'<p>Foobar</p>' '<p>Foobar</p>'
); );
} }
function testParagraphWrappingOnlyLink() { function testParagraphWrappingOnlyLink() {
$this->assertResult( $this->assertResult(
'http://example.com', 'http://example.com',
'<p><a href="http://example.com">http://example.com</a></p>' '<p><a href="http://example.com">http://example.com</a></p>'
); );
} }
function testParagraphWrappingNodeContainingLink() { function testParagraphWrappingNodeContainingLink() {
$this->assertResult( $this->assertResult(
'<b>http://example.com</b>', '<b>http://example.com</b>',
'<p><b><a href="http://example.com">http://example.com</a></b></p>' '<p><b><a href="http://example.com">http://example.com</a></b></p>'
); );
} }
function testParagraphWrappingPoorlyFormedNodeContainingLink() { function testParagraphWrappingPoorlyFormedNodeContainingLink() {
$this->assertResult( $this->assertResult(
'<b>http://example.com', '<b>http://example.com',
'<p><b><a href="http://example.com">http://example.com</a></b></p>' '<p><b><a href="http://example.com">http://example.com</a></b></p>'
); );
} }
function testTwoParagraphsContainingOnlyOneLink() { function testTwoParagraphsContainingOnlyOneLink() {
$this->assertResult( $this->assertResult(
"http://example.com\n\nhttp://dev.example.com", "http://example.com\n\nhttp://dev.example.com",
'<p><a href="http://example.com">http://example.com</a></p><p><a href="http://dev.example.com">http://dev.example.com</a></p>' '<p><a href="http://example.com">http://example.com</a></p><p><a href="http://dev.example.com">http://dev.example.com</a></p>'
); );
} }
function testParagraphNextToDivWithLinks() { function testParagraphNextToDivWithLinks() {
$this->assertResult( $this->assertResult(
'http://example.com <div>http://example.com</div>', 'http://example.com <div>http://example.com</div>',
'<p><a href="http://example.com">http://example.com</a> </p><div><a href="http://example.com">http://example.com</a></div>' '<p><a href="http://example.com">http://example.com</a> </p><div><a href="http://example.com">http://example.com</a></div>'
); );
} }
function testRealisticLinkInSentence() { function testRealisticLinkInSentence() {
$this->assertResult( $this->assertResult(
'This URL http://example.com is what you need', 'This URL http://example.com is what you need',
'<p>This URL <a href="http://example.com">http://example.com</a> is what you need</p>' '<p>This URL <a href="http://example.com">http://example.com</a> is what you need</p>'
); );
} }
function testParagraphAfterLinkifiedURL() { function testParagraphAfterLinkifiedURL() {
$this->assertResult( $this->assertResult(
"http://google.com\n\n<b>b</b>", "http://google.com\n\n<b>b</b>",
"<p><a href=\"http://google.com\">http://google.com</a></p><p><b>b</b></p>" "<p><a href=\"http://google.com\">http://google.com</a></p><p><b>b</b></p>"
); );
} }
} }

View File

@ -1,43 +1,43 @@
<?php <?php
class HTMLPurifier_Strategy_RemoveForeignElements_TidyTest class HTMLPurifier_Strategy_RemoveForeignElements_TidyTest
extends HTMLPurifier_StrategyHarness extends HTMLPurifier_StrategyHarness
{ {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->obj = new HTMLPurifier_Strategy_RemoveForeignElements(); $this->obj = new HTMLPurifier_Strategy_RemoveForeignElements();
$this->config->set('HTML', 'TidyLevel', 'heavy'); $this->config->set('HTML', 'TidyLevel', 'heavy');
} }
function testCenterTransform() { function testCenterTransform() {
$this->assertResult( $this->assertResult(
'<center>Look I am Centered!</center>', '<center>Look I am Centered!</center>',
'<div style="text-align:center;">Look I am Centered!</div>' '<div style="text-align:center;">Look I am Centered!</div>'
); );
} }
function testFontTransform() { function testFontTransform() {
$this->assertResult( $this->assertResult(
'<font color="red" face="Arial" size="6">Big Warning!</font>', '<font color="red" face="Arial" size="6">Big Warning!</font>',
'<span style="color:red;font-family:Arial;font-size:xx-large;">Big'. '<span style="color:red;font-family:Arial;font-size:xx-large;">Big'.
' Warning!</span>' ' Warning!</span>'
); );
} }
function testTransformToForbiddenElement() { function testTransformToForbiddenElement() {
$this->config->set('HTML', 'Allowed', 'div'); $this->config->set('HTML', 'Allowed', 'div');
$this->assertResult( $this->assertResult(
'<font color="red" face="Arial" size="6">Big Warning!</font>', '<font color="red" face="Arial" size="6">Big Warning!</font>',
'Big Warning!' 'Big Warning!'
); );
} }
function testMenuTransform() { function testMenuTransform() {
$this->assertResult( $this->assertResult(
'<menu><li>Item 1</li></menu>', '<menu><li>Item 1</li></menu>',
'<ul><li>Item 1</li></ul>' '<ul><li>Item 1</li></ul>'
); );
} }
} }

View File

@ -1,62 +1,62 @@
<?php <?php
class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_StrategyHarness class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_StrategyHarness
{ {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->obj = new HTMLPurifier_Strategy_ValidateAttributes(); $this->obj = new HTMLPurifier_Strategy_ValidateAttributes();
$this->config->set('Attr', 'EnableID', true); $this->config->set('Attr', 'EnableID', true);
} }
function testPreserveIDWhenEnabled() { function testPreserveIDWhenEnabled() {
$this->assertResult('<div id="valid">Preserve the ID.</div>'); $this->assertResult('<div id="valid">Preserve the ID.</div>');
} }
function testRemoveInvalidID() { function testRemoveInvalidID() {
$this->assertResult( $this->assertResult(
'<div id="0invalid">Kill the ID.</div>', '<div id="0invalid">Kill the ID.</div>',
'<div>Kill the ID.</div>' '<div>Kill the ID.</div>'
); );
} }
function testRemoveDuplicateID() { function testRemoveDuplicateID() {
$this->assertResult( $this->assertResult(
'<div id="valid">Valid</div><div id="valid">Invalid</div>', '<div id="valid">Valid</div><div id="valid">Invalid</div>',
'<div id="valid">Valid</div><div>Invalid</div>' '<div id="valid">Valid</div><div>Invalid</div>'
); );
} }
function testAttributeKeyCaseInsensitivity() { function testAttributeKeyCaseInsensitivity() {
$this->assertResult( $this->assertResult(
'<div ID="valid">Convert ID to lowercase.</div>', '<div ID="valid">Convert ID to lowercase.</div>',
'<div id="valid">Convert ID to lowercase.</div>' '<div id="valid">Convert ID to lowercase.</div>'
); );
} }
function testTrimWhitespace() { function testTrimWhitespace() {
$this->assertResult( $this->assertResult(
'<div id=" valid ">Trim whitespace.</div>', '<div id=" valid ">Trim whitespace.</div>',
'<div id="valid">Trim whitespace.</div>' '<div id="valid">Trim whitespace.</div>'
); );
} }
function testIDBlacklist() { function testIDBlacklist() {
$this->config->set('Attr', 'IDBlacklist', array('invalid')); $this->config->set('Attr', 'IDBlacklist', array('invalid'));
$this->assertResult( $this->assertResult(
'<div id="invalid">Invalid</div>', '<div id="invalid">Invalid</div>',
'<div>Invalid</div>' '<div>Invalid</div>'
); );
} }
function testNameConvertedToID() { function testNameConvertedToID() {
$this->config->set('HTML', 'TidyLevel', 'heavy'); $this->config->set('HTML', 'TidyLevel', 'heavy');
$this->assertResult( $this->assertResult(
'<a name="foobar" />', '<a name="foobar" />',
'<a id="foobar" />' '<a id="foobar" />'
); );
} }
} }

View File

@ -1,350 +1,350 @@
<?php <?php
class HTMLPurifier_Strategy_ValidateAttributes_TidyTest extends HTMLPurifier_StrategyHarness class HTMLPurifier_Strategy_ValidateAttributes_TidyTest extends HTMLPurifier_StrategyHarness
{ {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
$this->obj = new HTMLPurifier_Strategy_ValidateAttributes(); $this->obj = new HTMLPurifier_Strategy_ValidateAttributes();
$this->config->set('HTML', 'TidyLevel', 'heavy'); $this->config->set('HTML', 'TidyLevel', 'heavy');
} }
function testConvertCenterAlign() { function testConvertCenterAlign() {
$this->assertResult( $this->assertResult(
'<h1 align="center">Centered Headline</h1>', '<h1 align="center">Centered Headline</h1>',
'<h1 style="text-align:center;">Centered Headline</h1>' '<h1 style="text-align:center;">Centered Headline</h1>'
); );
} }
function testConvertRightAlign() { function testConvertRightAlign() {
$this->assertResult( $this->assertResult(
'<h1 align="right">Right-aligned Headline</h1>', '<h1 align="right">Right-aligned Headline</h1>',
'<h1 style="text-align:right;">Right-aligned Headline</h1>' '<h1 style="text-align:right;">Right-aligned Headline</h1>'
); );
} }
function testConvertLeftAlign() { function testConvertLeftAlign() {
$this->assertResult( $this->assertResult(
'<h1 align="left">Left-aligned Headline</h1>', '<h1 align="left">Left-aligned Headline</h1>',
'<h1 style="text-align:left;">Left-aligned Headline</h1>' '<h1 style="text-align:left;">Left-aligned Headline</h1>'
); );
} }
function testConvertJustifyAlign() { function testConvertJustifyAlign() {
$this->assertResult( $this->assertResult(
'<p align="justify">Justified Paragraph</p>', '<p align="justify">Justified Paragraph</p>',
'<p style="text-align:justify;">Justified Paragraph</p>' '<p style="text-align:justify;">Justified Paragraph</p>'
); );
} }
function testRemoveInvalidAlign() { function testRemoveInvalidAlign() {
$this->assertResult( $this->assertResult(
'<h1 align="invalid">Invalid Headline</h1>', '<h1 align="invalid">Invalid Headline</h1>',
'<h1>Invalid Headline</h1>' '<h1>Invalid Headline</h1>'
); );
} }
function testConvertTableLengths() { function testConvertTableLengths() {
$this->assertResult( $this->assertResult(
'<td width="5%" height="10" /><th width="10" height="5%" /><hr width="10" height="10" />', '<td width="5%" height="10" /><th width="10" height="5%" /><hr width="10" height="10" />',
'<td style="width:5%;height:10px;" /><th style="width:10px;height:5%;" /><hr style="width:10px;" />' '<td style="width:5%;height:10px;" /><th style="width:10px;height:5%;" /><hr style="width:10px;" />'
); );
} }
function testTdConvertNowrap() { function testTdConvertNowrap() {
$this->assertResult( $this->assertResult(
'<td nowrap />', '<td nowrap />',
'<td style="white-space:nowrap;" />' '<td style="white-space:nowrap;" />'
); );
} }
function testCaptionConvertAlignLeft() { function testCaptionConvertAlignLeft() {
$this->assertResult( $this->assertResult(
'<caption align="left" />', '<caption align="left" />',
'<caption style="text-align:left;" />' '<caption style="text-align:left;" />'
); );
} }
function testCaptionConvertAlignRight() { function testCaptionConvertAlignRight() {
$this->assertResult( $this->assertResult(
'<caption align="right" />', '<caption align="right" />',
'<caption style="text-align:right;" />' '<caption style="text-align:right;" />'
); );
} }
function testCaptionConvertAlignTop() { function testCaptionConvertAlignTop() {
$this->assertResult( $this->assertResult(
'<caption align="top" />', '<caption align="top" />',
'<caption style="caption-side:top;" />' '<caption style="caption-side:top;" />'
); );
} }
function testCaptionConvertAlignBottom() { function testCaptionConvertAlignBottom() {
$this->assertResult( $this->assertResult(
'<caption align="bottom" />', '<caption align="bottom" />',
'<caption style="caption-side:bottom;" />' '<caption style="caption-side:bottom;" />'
); );
} }
function testCaptionRemoveInvalidAlign() { function testCaptionRemoveInvalidAlign() {
$this->assertResult( $this->assertResult(
'<caption align="nonsense" />', '<caption align="nonsense" />',
'<caption />' '<caption />'
); );
} }
function testTableConvertAlignLeft() { function testTableConvertAlignLeft() {
$this->assertResult( $this->assertResult(
'<table align="left" />', '<table align="left" />',
'<table style="float:left;" />' '<table style="float:left;" />'
); );
} }
function testTableConvertAlignCenter() { function testTableConvertAlignCenter() {
$this->assertResult( $this->assertResult(
'<table align="center" />', '<table align="center" />',
'<table style="margin-left:auto;margin-right:auto;" />' '<table style="margin-left:auto;margin-right:auto;" />'
); );
} }
function testTableConvertAlignRight() { function testTableConvertAlignRight() {
$this->assertResult( $this->assertResult(
'<table align="right" />', '<table align="right" />',
'<table style="float:right;" />' '<table style="float:right;" />'
); );
} }
function testTableRemoveInvalidAlign() { function testTableRemoveInvalidAlign() {
$this->assertResult( $this->assertResult(
'<table align="top" />', '<table align="top" />',
'<table />' '<table />'
); );
} }
function testImgConvertAlignLeft() { function testImgConvertAlignLeft() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="left" />', '<img src="foobar.jpg" alt="foobar" align="left" />',
'<img src="foobar.jpg" alt="foobar" style="float:left;" />' '<img src="foobar.jpg" alt="foobar" style="float:left;" />'
); );
} }
function testImgConvertAlignRight() { function testImgConvertAlignRight() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="right" />', '<img src="foobar.jpg" alt="foobar" align="right" />',
'<img src="foobar.jpg" alt="foobar" style="float:right;" />' '<img src="foobar.jpg" alt="foobar" style="float:right;" />'
); );
} }
function testImgConvertAlignBottom() { function testImgConvertAlignBottom() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="bottom" />', '<img src="foobar.jpg" alt="foobar" align="bottom" />',
'<img src="foobar.jpg" alt="foobar" style="vertical-align:baseline;" />' '<img src="foobar.jpg" alt="foobar" style="vertical-align:baseline;" />'
); );
} }
function testImgConvertAlignMiddle() { function testImgConvertAlignMiddle() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="middle" />', '<img src="foobar.jpg" alt="foobar" align="middle" />',
'<img src="foobar.jpg" alt="foobar" style="vertical-align:middle;" />' '<img src="foobar.jpg" alt="foobar" style="vertical-align:middle;" />'
); );
} }
function testImgConvertAlignTop() { function testImgConvertAlignTop() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="top" />', '<img src="foobar.jpg" alt="foobar" align="top" />',
'<img src="foobar.jpg" alt="foobar" style="vertical-align:top;" />' '<img src="foobar.jpg" alt="foobar" style="vertical-align:top;" />'
); );
} }
function testImgRemoveInvalidAlign() { function testImgRemoveInvalidAlign() {
$this->assertResult( $this->assertResult(
'<img src="foobar.jpg" alt="foobar" align="outerspace" />', '<img src="foobar.jpg" alt="foobar" align="outerspace" />',
'<img src="foobar.jpg" alt="foobar" />' '<img src="foobar.jpg" alt="foobar" />'
); );
} }
function testBorderConvertHVSpace() { function testBorderConvertHVSpace() {
$this->assertResult( $this->assertResult(
'<img src="foo" alt="foo" hspace="1" vspace="3" />', '<img src="foo" alt="foo" hspace="1" vspace="3" />',
'<img src="foo" alt="foo" style="margin-top:3px;margin-bottom:3px;margin-left:1px;margin-right:1px;" />' '<img src="foo" alt="foo" style="margin-top:3px;margin-bottom:3px;margin-left:1px;margin-right:1px;" />'
); );
} }
function testHrConvertSize() { function testHrConvertSize() {
$this->assertResult( $this->assertResult(
'<hr size="3" />', '<hr size="3" />',
'<hr style="height:3px;" />' '<hr style="height:3px;" />'
); );
} }
function testHrConvertNoshade() { function testHrConvertNoshade() {
$this->assertResult( $this->assertResult(
'<hr noshade />', '<hr noshade />',
'<hr style="color:#808080;background-color:#808080;border:0;" />' '<hr style="color:#808080;background-color:#808080;border:0;" />'
); );
} }
function testHrConvertAlignLeft() { function testHrConvertAlignLeft() {
$this->assertResult( $this->assertResult(
'<hr align="left" />', '<hr align="left" />',
'<hr style="margin-left:0;margin-right:auto;text-align:left;" />' '<hr style="margin-left:0;margin-right:auto;text-align:left;" />'
); );
} }
function testHrConvertAlignCenter() { function testHrConvertAlignCenter() {
$this->assertResult( $this->assertResult(
'<hr align="center" />', '<hr align="center" />',
'<hr style="margin-left:auto;margin-right:auto;text-align:center;" />' '<hr style="margin-left:auto;margin-right:auto;text-align:center;" />'
); );
} }
function testHrConvertAlignRight() { function testHrConvertAlignRight() {
$this->assertResult( $this->assertResult(
'<hr align="right" />', '<hr align="right" />',
'<hr style="margin-left:auto;margin-right:0;text-align:right;" />' '<hr style="margin-left:auto;margin-right:0;text-align:right;" />'
); );
} }
function testHrRemoveInvalidAlign() { function testHrRemoveInvalidAlign() {
$this->assertResult( $this->assertResult(
'<hr align="bottom" />', '<hr align="bottom" />',
'<hr />' '<hr />'
); );
} }
function testBrConvertClearLeft() { function testBrConvertClearLeft() {
$this->assertResult( $this->assertResult(
'<br clear="left" />', '<br clear="left" />',
'<br style="clear:left;" />' '<br style="clear:left;" />'
); );
} }
function testBrConvertClearRight() { function testBrConvertClearRight() {
$this->assertResult( $this->assertResult(
'<br clear="right" />', '<br clear="right" />',
'<br style="clear:right;" />' '<br style="clear:right;" />'
); );
} }
function testBrConvertClearAll() { function testBrConvertClearAll() {
$this->assertResult( $this->assertResult(
'<br clear="all" />', '<br clear="all" />',
'<br style="clear:both;" />' '<br style="clear:both;" />'
); );
} }
function testBrConvertClearNone() { function testBrConvertClearNone() {
$this->assertResult( $this->assertResult(
'<br clear="none" />', '<br clear="none" />',
'<br style="clear:none;" />' '<br style="clear:none;" />'
); );
} }
function testBrRemoveInvalidClear() { function testBrRemoveInvalidClear() {
$this->assertResult( $this->assertResult(
'<br clear="foo" />', '<br clear="foo" />',
'<br />' '<br />'
); );
} }
function testUlConvertTypeDisc() { function testUlConvertTypeDisc() {
$this->assertResult( $this->assertResult(
'<ul type="disc" />', '<ul type="disc" />',
'<ul style="list-style-type:disc;" />' '<ul style="list-style-type:disc;" />'
); );
} }
function testUlConvertTypeSquare() { function testUlConvertTypeSquare() {
$this->assertResult( $this->assertResult(
'<ul type="square" />', '<ul type="square" />',
'<ul style="list-style-type:square;" />' '<ul style="list-style-type:square;" />'
); );
} }
function testUlConvertTypeCircle() { function testUlConvertTypeCircle() {
$this->assertResult( $this->assertResult(
'<ul type="circle" />', '<ul type="circle" />',
'<ul style="list-style-type:circle;" />' '<ul style="list-style-type:circle;" />'
); );
} }
function testUlConvertTypeCaseInsensitive() { function testUlConvertTypeCaseInsensitive() {
$this->assertResult( $this->assertResult(
'<ul type="CIRCLE" />', '<ul type="CIRCLE" />',
'<ul style="list-style-type:circle;" />' '<ul style="list-style-type:circle;" />'
); );
} }
function testUlRemoveInvalidType() { function testUlRemoveInvalidType() {
$this->assertResult( $this->assertResult(
'<ul type="a" />', '<ul type="a" />',
'<ul />' '<ul />'
); );
} }
function testOlConvertType1() { function testOlConvertType1() {
$this->assertResult( $this->assertResult(
'<ol type="1" />', '<ol type="1" />',
'<ol style="list-style-type:decimal;" />' '<ol style="list-style-type:decimal;" />'
); );
} }
function testOlConvertTypeLowerI() { function testOlConvertTypeLowerI() {
$this->assertResult( $this->assertResult(
'<ol type="i" />', '<ol type="i" />',
'<ol style="list-style-type:lower-roman;" />' '<ol style="list-style-type:lower-roman;" />'
); );
} }
function testOlConvertTypeUpperI() { function testOlConvertTypeUpperI() {
$this->assertResult( $this->assertResult(
'<ol type="I" />', '<ol type="I" />',
'<ol style="list-style-type:upper-roman;" />' '<ol style="list-style-type:upper-roman;" />'
); );
} }
function testOlConvertTypeLowerA() { function testOlConvertTypeLowerA() {
$this->assertResult( $this->assertResult(
'<ol type="a" />', '<ol type="a" />',
'<ol style="list-style-type:lower-alpha;" />' '<ol style="list-style-type:lower-alpha;" />'
); );
} }
function testOlConvertTypeUpperA() { function testOlConvertTypeUpperA() {
$this->assertResult( $this->assertResult(
'<ol type="A" />', '<ol type="A" />',
'<ol style="list-style-type:upper-alpha;" />' '<ol style="list-style-type:upper-alpha;" />'
); );
} }
function testOlRemoveInvalidType() { function testOlRemoveInvalidType() {
$this->assertResult( $this->assertResult(
'<ol type="disc" />', '<ol type="disc" />',
'<ol />' '<ol />'
); );
} }
function testLiConvertTypeCircle() { function testLiConvertTypeCircle() {
$this->assertResult( $this->assertResult(
'<li type="circle" />', '<li type="circle" />',
'<li style="list-style-type:circle;" />' '<li style="list-style-type:circle;" />'
); );
} }
function testLiConvertTypeA() { function testLiConvertTypeA() {
$this->assertResult( $this->assertResult(
'<li type="A" />', '<li type="A" />',
'<li style="list-style-type:upper-alpha;" />' '<li style="list-style-type:upper-alpha;" />'
); );
} }
function testLiConvertTypeCaseSensitive() { function testLiConvertTypeCaseSensitive() {
$this->assertResult( $this->assertResult(
'<li type="CIRCLE" />', '<li type="CIRCLE" />',
'<li />' '<li />'
); );
} }
} }

View File

@ -1,22 +1,22 @@
<?php <?php
/** /**
* Controller for PHPT that implements the SimpleTest unit-testing interface. * Controller for PHPT that implements the SimpleTest unit-testing interface.
*/ */
class PHPT_Controller_SimpleTest extends SimpleTestCase class PHPT_Controller_SimpleTest extends SimpleTestCase
{ {
protected $_path; protected $_path;
public function __construct($path) { public function __construct($path) {
$this->_path = $path; $this->_path = $path;
parent::__construct($path); parent::__construct($path);
} }
public function testPhpt() { public function testPhpt() {
$suite = new PHPT_Suite(array($this->_path)); $suite = new PHPT_Suite(array($this->_path));
$phpt_reporter = new PHPT_Reporter_SimpleTest($this->reporter); $phpt_reporter = new PHPT_Reporter_SimpleTest($this->reporter);
$suite->run($phpt_reporter); $suite->run($phpt_reporter);
} }
} }

View File

@ -1,75 +1,75 @@
<?php <?php
/** /**
* Proxies results from PHPT_Reporter to SimpleTest's reporter * Proxies results from PHPT_Reporter to SimpleTest's reporter
*/ */
class PHPT_Reporter_SimpleTest implements PHPT_Reporter class PHPT_Reporter_SimpleTest implements PHPT_Reporter
{ {
/** SimpleTest reporter to proxy results to */ /** SimpleTest reporter to proxy results to */
protected $reporter; protected $reporter;
/** @param SimpleTest reporter */ /** @param SimpleTest reporter */
public function __construct($reporter) { public function __construct($reporter) {
$this->reporter = $reporter; $this->reporter = $reporter;
} }
// TODO: Figure out what the proper calls should be, since we've given // TODO: Figure out what the proper calls should be, since we've given
// each Suite its own UnitTestCase controller // each Suite its own UnitTestCase controller
/** /**
* Called when the Reporter is started from a PHPT_Suite * Called when the Reporter is started from a PHPT_Suite
* @todo Figure out if Suites can be named * @todo Figure out if Suites can be named
*/ */
public function onSuiteStart(PHPT_Suite $suite) { public function onSuiteStart(PHPT_Suite $suite) {
//$this->reporter->paintGroupStart('PHPT Suite', $suite->count()); //$this->reporter->paintGroupStart('PHPT Suite', $suite->count());
} }
/** /**
* Called when the Reporter is finished in a PHPT_Suite * Called when the Reporter is finished in a PHPT_Suite
*/ */
public function onSuiteEnd(PHPT_Suite $suite) { public function onSuiteEnd(PHPT_Suite $suite) {
//$this->reporter->paintGroupEnd('PHPT Suite'); //$this->reporter->paintGroupEnd('PHPT Suite');
} }
/** /**
* Called when a Case is started * Called when a Case is started
*/ */
public function onCaseStart(PHPT_Case $case) { public function onCaseStart(PHPT_Case $case) {
//$this->reporter->paintCaseStart($case->name); //$this->reporter->paintCaseStart($case->name);
} }
/** /**
* Called when a Case ends * Called when a Case ends
*/ */
public function onCaseEnd(PHPT_Case $case) { public function onCaseEnd(PHPT_Case $case) {
//$this->reporter->paintCaseEnd($case->name); //$this->reporter->paintCaseEnd($case->name);
} }
/** /**
* Called when a Case runs without Exception * Called when a Case runs without Exception
*/ */
public function onCasePass(PHPT_Case $case) { public function onCasePass(PHPT_Case $case) {
$this->reporter->paintPass("{$case->name} in {$case->filename}"); $this->reporter->paintPass("{$case->name} in {$case->filename}");
} }
/** /**
* Called when a PHPT_Case_VetoException is thrown during a Case's run() * Called when a PHPT_Case_VetoException is thrown during a Case's run()
*/ */
public function onCaseSkip(PHPT_Case $case, PHPT_Case_VetoException $veto) { public function onCaseSkip(PHPT_Case $case, PHPT_Case_VetoException $veto) {
$this->reporter->paintSkip($veto->getMessage() . ' [' . $case->filename .']'); $this->reporter->paintSkip($veto->getMessage() . ' [' . $case->filename .']');
} }
/** /**
* Called when any Exception other than a PHPT_Case_VetoException is encountered * Called when any Exception other than a PHPT_Case_VetoException is encountered
* during a Case's run() * during a Case's run()
*/ */
public function onCaseFail(PHPT_Case $case, PHPT_Case_FailureException $failure) { public function onCaseFail(PHPT_Case $case, PHPT_Case_FailureException $failure) {
$this->reporter->paintFail($failure->getReason()); $this->reporter->paintFail($failure->getReason());
} }
public function onParserError(Exception $exception) { public function onParserError(Exception $exception) {
$this->reporter->paintException($exception); $this->reporter->paintException($exception);
} }
} }