mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 05:37:49 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5b46727358 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
|||||||
configdoc/usage.xml -crlf
|
|
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,9 +0,0 @@
|
|||||||
conf/
|
|
||||||
library/HTMLPurifier/DefinitionCache/Serializer/*/
|
|
||||||
library/standalone/
|
|
||||||
library/HTMLPurifier.standalone.php
|
|
||||||
*.phpt.diff
|
|
||||||
*.phpt.exp
|
|
||||||
*.phpt.log
|
|
||||||
*.phpt.out
|
|
||||||
*.phpt.php
|
|
2
Doxyfile
2
Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = HTMLPurifier
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 3.1.1
|
PROJECT_NUMBER = 3.1.0
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
|
13
FOCUS
13
FOCUS
@@ -1,13 +0,0 @@
|
|||||||
9 - Major security fixes
|
|
||||||
|
|
||||||
[ Appendix A: Release focus IDs ]
|
|
||||||
0 - N/A
|
|
||||||
1 - Initial freshmeat announcement
|
|
||||||
2 - Documentation
|
|
||||||
3 - Code cleanup
|
|
||||||
4 - Minor feature enhancements
|
|
||||||
5 - Major feature enhancements
|
|
||||||
6 - Minor bugfixes
|
|
||||||
7 - Major bugfixes
|
|
||||||
8 - Minor security fixes
|
|
||||||
9 - Major security fixes
|
|
5
INSTALL
5
INSTALL
@@ -23,9 +23,8 @@ August 8, 2008.
|
|||||||
|
|
||||||
These optional extensions can enhance the capabilities of HTML Purifier:
|
These optional extensions can enhance the capabilities of HTML Purifier:
|
||||||
|
|
||||||
* iconv : Converts text to and from non-UTF-8 encodings
|
* iconv : Converts text to and from non-UTF-8 encodings
|
||||||
* bcmath : Used for unit conversion and imagecrash protection
|
* tidy : Used for pretty-printing HTML
|
||||||
* tidy : Used for pretty-printing HTML
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
80
NEWS
80
NEWS
@@ -9,83 +9,6 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
. Internal change
|
. Internal change
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
3.2.0, unknown release date
|
|
||||||
|
|
||||||
3.1.2, unknown release date
|
|
||||||
|
|
||||||
3.1.1, released 2008-06-19
|
|
||||||
# %URI.Munge now, by default, does not munge resources (for example, <img src="">)
|
|
||||||
In order to enable this again, please set %URI.MungeResources to true.
|
|
||||||
! More robust imagecrash protection with height/width CSS with %CSS.MaxImgLength,
|
|
||||||
and height/width HTML with %HTML.MaxImgLength.
|
|
||||||
! %URI.MungeSecretKey for secure URI munging. Thanks Chris
|
|
||||||
for sponsoring this feature. Check out the corresponding documentation
|
|
||||||
for details. (Att Nightly testers: The API for this feature changed before
|
|
||||||
the general release. Namely, rename your directives %URI.SecureMungeSecretKey =>
|
|
||||||
%URI.MungeSecretKey and and %URI.SecureMunge => %URI.Munge)
|
|
||||||
! Implemented post URI filtering. Set member variable $post to true to set
|
|
||||||
a URIFilter as such.
|
|
||||||
! Allow modules to define injectors via $info_injector. Injectors are
|
|
||||||
automatically disabled if injector's needed elements are not found.
|
|
||||||
! Support for "safe" objects added, use %HTML.SafeObject and %HTML.SafeEmbed.
|
|
||||||
Thanks Chris for sponsoring. If you've been using ad hoc code from the
|
|
||||||
forums, PLEASE use this instead.
|
|
||||||
! Added substitutions for %e, %n, %a and %p in %URI.Munge (in order,
|
|
||||||
embedded, tag name, attribute name, CSS property name). See %URI.Munge
|
|
||||||
for more details. Requested by Jochem Blok.
|
|
||||||
- Disable percent height/width attributes for img.
|
|
||||||
- AttrValidator operations are now atomic; updates to attributes are not
|
|
||||||
manifest in token until end of operations. This prevents naughty internal
|
|
||||||
code from directly modifying CurrentToken when they're not supposed to.
|
|
||||||
This semantics change was requested by frank farmer.
|
|
||||||
- Percent encoding checks enabled for URI query and fragment
|
|
||||||
- Fix stray backslashes in font-family; CSS Unicode character escapes are
|
|
||||||
now properly resolved (although *only* in font-family). Thanks Takeshi Terada
|
|
||||||
for reporting.
|
|
||||||
- Improve parseCDATA algorithm to take into account newline normalization
|
|
||||||
- Account for browser confusion between Yen character and backslash in
|
|
||||||
Shift_JIS encoding. This fix generalizes to any other encoding which is not
|
|
||||||
a strict superset of printable ASCII. Thanks Takeshi Terada for reporting.
|
|
||||||
- Fix missing configuration parameter in Generator calls. Thanks vs for the
|
|
||||||
partial patch.
|
|
||||||
- Improved adherence to Unicode by checking for non-character codepoints.
|
|
||||||
Thanks Geoffrey Sneddon for reporting. This may result in degraded
|
|
||||||
performance for extremely large inputs.
|
|
||||||
- Allow CSS property-value pair ''text-decoration: none''. Thanks Jochem Blok
|
|
||||||
for reporting.
|
|
||||||
. Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient
|
|
||||||
handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses
|
|
||||||
this class.
|
|
||||||
. API of HTMLPurifier_AttrDef_CSS_Length changed from __construct($disable_negative)
|
|
||||||
to __construct($min, $max). __construct(true) is equivalent to
|
|
||||||
__construct('0').
|
|
||||||
. Added HTMLPurifier_AttrDef_Switch class
|
|
||||||
. Rename HTMLPurifier_HTMLModule_Tidy->construct() to setup() and bubble method
|
|
||||||
up inheritance hierarchy to HTMLPurifier_HTMLModule. All HTMLModules
|
|
||||||
get this called with the configuration object. All modules now
|
|
||||||
use this rather than __construct(), although legacy code using constructors
|
|
||||||
will still work--the new format, however, lets modules access the
|
|
||||||
configuration object for HTML namespace dependant tweaks.
|
|
||||||
. AttrDef_HTML_Pixels now takes a single construction parameter, pixels.
|
|
||||||
. ConfigSchema data-structure heavily optimized; on average it uses a third
|
|
||||||
the memory it did previously. The interface has changed accordingly,
|
|
||||||
consult changes to HTMLPurifier_Config for details.
|
|
||||||
. Variable parsing types now are magic integers instead of strings
|
|
||||||
. Added benchmark for ConfigSchema
|
|
||||||
. HTMLPurifier_Generator requires $config and $context parameters. If you
|
|
||||||
don't know what they should be, use HTMLPurifier_Config::createDefault()
|
|
||||||
and new HTMLPurifier_Context().
|
|
||||||
. Printers now properly distinguish between output configuration, and
|
|
||||||
target configuration. This is not applicable to scripts using
|
|
||||||
the Printers for HTML Purifier related tasks.
|
|
||||||
. HTML/CSS Printers must be primed with prepareGenerator($gen_config), otherwise
|
|
||||||
fatal errors will ensue.
|
|
||||||
. URIFilter->prepare can return false in order to abort loading of the filter
|
|
||||||
. Factory for AttrDef_URI implemented, URI#embedded to indicate URI that embeds
|
|
||||||
an external resource.
|
|
||||||
. %URI.Munge functionality factored out into a post-filter class.
|
|
||||||
. Added CurrentCSSProperty context variable during CSS validation
|
|
||||||
|
|
||||||
3.1.0, released 2008-05-18
|
3.1.0, released 2008-05-18
|
||||||
# Unnecessary references to objects (vestiges of PHP4) removed from method
|
# Unnecessary references to objects (vestiges of PHP4) removed from method
|
||||||
signatures. The following methods do not need references when assigning from
|
signatures. The following methods do not need references when assigning from
|
||||||
@@ -110,8 +33,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
and allows for version numbers like "3.1.0-dev".
|
and allows for version numbers like "3.1.0-dev".
|
||||||
! %HTML.Allowed deals gracefully with whitespace anywhere, anytime!
|
! %HTML.Allowed deals gracefully with whitespace anywhere, anytime!
|
||||||
! HTML Purifier's URI handling is a lot more robust, with much stricter
|
! HTML Purifier's URI handling is a lot more robust, with much stricter
|
||||||
validation checks and better percent encoding handling. Thanks Gareth Heyes
|
validation checks and better percent encoding handling.
|
||||||
for indicating security vulnerabilities from lax percent encoding.
|
|
||||||
! Bootstrap autoloader deals more robustly with classes that don't exist,
|
! Bootstrap autoloader deals more robustly with classes that don't exist,
|
||||||
preventing class_exists($class, true) from barfing.
|
preventing class_exists($class, true) from barfing.
|
||||||
- InterchangeBuilder now alphabetizes its lists
|
- InterchangeBuilder now alphabetizes its lists
|
||||||
|
11
TODO
11
TODO
@@ -11,22 +11,18 @@ If no interest is expressed for a feature that may require a considerable
|
|||||||
amount of effort to implement, it may get endlessly delayed. Do not be
|
amount of effort to implement, it may get endlessly delayed. Do not be
|
||||||
afraid to cast your vote for the next feature to be implemented!
|
afraid to cast your vote for the next feature to be implemented!
|
||||||
|
|
||||||
- Investigate how early internal structures can be accessed; this would
|
- Implement validation for query and for fragment
|
||||||
prevent structures from being parsed and serialized multiple times.
|
|
||||||
- Built-in support for target="_blank" on all external links
|
|
||||||
- Gitify the repository
|
|
||||||
|
|
||||||
FUTURE VERSIONS
|
FUTURE VERSIONS
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
3.2 release [It's All About Trust] (floating)
|
3.2 release [It's All About Trust] (floating)
|
||||||
# Implement untrusted, dangerous elements/attributes
|
# Implement untrusted, dangerous elements/attributes
|
||||||
- Forms are especially wanted
|
- Objects and Forms are especially wanted
|
||||||
# Implement IDREF support (harder than it seems, since you cannot have
|
# Implement IDREF support (harder than it seems, since you cannot have
|
||||||
IDREFs to non-existent IDs)
|
IDREFs to non-existent IDs)
|
||||||
# Frameset XHTML 1.0 and HTML 4.01 doctypes
|
# Frameset XHTML 1.0 and HTML 4.01 doctypes
|
||||||
- Implement <area>
|
- Research and implement a "safe" version of the Object module
|
||||||
- Figure out how to simultaneously set %CSS.Trusted and %HTML.Trusted (?)
|
|
||||||
|
|
||||||
3.3 release [Error'ed]
|
3.3 release [Error'ed]
|
||||||
# Error logging for filtering/cleanup procedures
|
# Error logging for filtering/cleanup procedures
|
||||||
@@ -108,7 +104,6 @@ Neat feature related
|
|||||||
- Full set of color keywords. Also, a way to add onto them without
|
- Full set of color keywords. Also, a way to add onto them without
|
||||||
finalizing the configuration object.
|
finalizing the configuration object.
|
||||||
- Write a var_export and memcached DefinitionCache - Denis
|
- Write a var_export and memcached DefinitionCache - Denis
|
||||||
- Allow restriction of allowed class values
|
|
||||||
|
|
||||||
Maintenance related (slightly boring)
|
Maintenance related (slightly boring)
|
||||||
# CHMOD install script for PEAR installs
|
# CHMOD install script for PEAR installs
|
||||||
|
18
WHATSNEW
18
WHATSNEW
@@ -1,8 +1,10 @@
|
|||||||
HTML Purifier 3.1.1 is a security and bugfix release. This release addresses
|
HTML Purifier 3.1.0 is the second release series for HTML Purifier on PHP 5
|
||||||
two security vulnerabilities, both related to CSS, and one of which only
|
as well as a security update related to URIs. It shifts over to using
|
||||||
applies to users using Shift_JIS as their output encoding. There is also
|
autoload, and also includes support for the !important CSS modifier,
|
||||||
a security improvement regarding the imagecrash attack. There is a backwards
|
display and visibility CSS properties with %CSS.AllowTricky, marquee with
|
||||||
incompatible change in which resources are no longer munged
|
%HTML.Proprietary (had you scared for a moment, hmm?), a kses() wrapper,
|
||||||
by default; please enable using %URI.MungeResources. Besides this, there
|
%CSS.AllowedProperties, %HTML.ForbiddenAttributes and
|
||||||
are numerous improvements to URI munging, esp. with the addition of
|
%HTML.ForbiddenElements and a totally revamped ConfigDoc system. Since the
|
||||||
%URI.MungeSecretKey, as well as an experimental %HTML.SafeObject and %HTML.SafeEmbed.
|
release candidate, there have also been a number of stability fixes such as
|
||||||
|
improved URI escaping, a change in serializer ID format, and a relaxed
|
||||||
|
format for %HTML.Allowed. And as always, numerous bugfixes.
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
chdir(dirname(__FILE__));
|
|
||||||
|
|
||||||
//require_once '../library/HTMLPurifier.path.php';
|
|
||||||
shell_exec('php ../maintenance/generate-schema-cache.php');
|
|
||||||
require_once '../library/HTMLPurifier.path.php';
|
|
||||||
require_once 'HTMLPurifier.includes.php';
|
|
||||||
|
|
||||||
$begin = xdebug_memory_usage();
|
|
||||||
|
|
||||||
$schema = HTMLPurifier_ConfigSchema::makeFromSerial();
|
|
||||||
|
|
||||||
echo xdebug_memory_usage() - $begin;
|
|
@@ -19,7 +19,7 @@
|
|||||||
<xsl:variable name="usageLookup" select="document('../usage.xml')/usage" />
|
<xsl:variable name="usageLookup" select="document('../usage.xml')/usage" />
|
||||||
|
|
||||||
<!-- Twiddle this variable to get the columns as even as possible -->
|
<!-- Twiddle this variable to get the columns as even as possible -->
|
||||||
<xsl:variable name="maxNumberAdjust" select="2" />
|
<xsl:variable name="maxNumberAdjust" select="1" />
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<html lang="en" xml:lang="en">
|
<html lang="en" xml:lang="en">
|
||||||
|
@@ -16,29 +16,24 @@
|
|||||||
<line>44</line>
|
<line>44</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="CSS.MaxImgLength">
|
|
||||||
<file name="HTMLPurifier/CSSDefinition.php">
|
|
||||||
<line>157</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
<directive id="CSS.Proprietary">
|
<directive id="CSS.Proprietary">
|
||||||
<file name="HTMLPurifier/CSSDefinition.php">
|
<file name="HTMLPurifier/CSSDefinition.php">
|
||||||
<line>214</line>
|
<line>202</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="CSS.AllowTricky">
|
<directive id="CSS.AllowTricky">
|
||||||
<file name="HTMLPurifier/CSSDefinition.php">
|
<file name="HTMLPurifier/CSSDefinition.php">
|
||||||
<line>218</line>
|
<line>206</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="CSS.AllowImportant">
|
<directive id="CSS.AllowImportant">
|
||||||
<file name="HTMLPurifier/CSSDefinition.php">
|
<file name="HTMLPurifier/CSSDefinition.php">
|
||||||
<line>222</line>
|
<line>210</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="CSS.AllowedProperties">
|
<directive id="CSS.AllowedProperties">
|
||||||
<file name="HTMLPurifier/CSSDefinition.php">
|
<file name="HTMLPurifier/CSSDefinition.php">
|
||||||
<line>274</line>
|
<line>262</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Cache.DefinitionImpl">
|
<directive id="Cache.DefinitionImpl">
|
||||||
@@ -68,19 +63,19 @@
|
|||||||
</directive>
|
</directive>
|
||||||
<directive id="Core.Encoding">
|
<directive id="Core.Encoding">
|
||||||
<file name="HTMLPurifier/Encoder.php">
|
<file name="HTMLPurifier/Encoder.php">
|
||||||
<line>267</line>
|
<line>281</line>
|
||||||
<line>294</line>
|
<line>305</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Test.ForceNoIconv">
|
<directive id="Test.ForceNoIconv">
|
||||||
<file name="HTMLPurifier/Encoder.php">
|
<file name="HTMLPurifier/Encoder.php">
|
||||||
<line>272</line>
|
<line>283</line>
|
||||||
<line>302</line>
|
<line>310</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Core.EscapeNonASCIICharacters">
|
<directive id="Core.EscapeNonASCIICharacters">
|
||||||
<file name="HTMLPurifier/Encoder.php">
|
<file name="HTMLPurifier/Encoder.php">
|
||||||
<line>298</line>
|
<line>307</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Core.MaintainLineNumbers">
|
<directive id="Core.MaintainLineNumbers">
|
||||||
@@ -96,52 +91,52 @@
|
|||||||
</directive>
|
</directive>
|
||||||
<directive id="Output.CommentScriptContents">
|
<directive id="Output.CommentScriptContents">
|
||||||
<file name="HTMLPurifier/Generator.php">
|
<file name="HTMLPurifier/Generator.php">
|
||||||
<line>40</line>
|
<line>41</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Output.TidyFormat">
|
<directive id="Output.TidyFormat">
|
||||||
<file name="HTMLPurifier/Generator.php">
|
<file name="HTMLPurifier/Generator.php">
|
||||||
<line>69</line>
|
<line>70</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Output.Newline">
|
<directive id="Output.Newline">
|
||||||
<file name="HTMLPurifier/Generator.php">
|
<file name="HTMLPurifier/Generator.php">
|
||||||
<line>83</line>
|
<line>84</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.BlockWrapper">
|
<directive id="HTML.BlockWrapper">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>222</line>
|
<line>213</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.Parent">
|
<directive id="HTML.Parent">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>230</line>
|
<line>221</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.AllowedElements">
|
<directive id="HTML.AllowedElements">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>247</line>
|
<line>238</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.AllowedAttributes">
|
<directive id="HTML.AllowedAttributes">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>248</line>
|
<line>239</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.Allowed">
|
<directive id="HTML.Allowed">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>251</line>
|
<line>242</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.ForbiddenElements">
|
<directive id="HTML.ForbiddenElements">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>337</line>
|
<line>328</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.ForbiddenAttributes">
|
<directive id="HTML.ForbiddenAttributes">
|
||||||
<file name="HTMLPurifier/HTMLDefinition.php">
|
<file name="HTMLPurifier/HTMLDefinition.php">
|
||||||
<line>338</line>
|
<line>329</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.Trusted">
|
<directive id="HTML.Trusted">
|
||||||
@@ -151,9 +146,6 @@
|
|||||||
<file name="HTMLPurifier/Lexer.php">
|
<file name="HTMLPurifier/Lexer.php">
|
||||||
<line>238</line>
|
<line>238</line>
|
||||||
</file>
|
</file>
|
||||||
<file name="HTMLPurifier/HTMLModule/Image.php">
|
|
||||||
<line>27</line>
|
|
||||||
</file>
|
|
||||||
<file name="HTMLPurifier/Lexer/DirectLex.php">
|
<file name="HTMLPurifier/Lexer/DirectLex.php">
|
||||||
<line>34</line>
|
<line>34</line>
|
||||||
</file>
|
</file>
|
||||||
@@ -173,16 +165,6 @@
|
|||||||
<line>220</line>
|
<line>220</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.SafeObject">
|
|
||||||
<file name="HTMLPurifier/HTMLModuleManager.php">
|
|
||||||
<line>225</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
<directive id="HTML.SafeEmbed">
|
|
||||||
<file name="HTMLPurifier/HTMLModuleManager.php">
|
|
||||||
<line>228</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
<directive id="Attr.IDBlacklist">
|
<directive id="Attr.IDBlacklist">
|
||||||
<file name="HTMLPurifier/IDAccumulator.php">
|
<file name="HTMLPurifier/IDAccumulator.php">
|
||||||
<line>26</line>
|
<line>26</line>
|
||||||
@@ -205,7 +187,7 @@
|
|||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.Host">
|
<directive id="URI.Host">
|
||||||
<file name="HTMLPurifier/URIDefinition.php">
|
<file name="HTMLPurifier/URIDefinition.php">
|
||||||
<line>64</line>
|
<line>57</line>
|
||||||
</file>
|
</file>
|
||||||
<file name="HTMLPurifier/URIFilter/DisableExternal.php">
|
<file name="HTMLPurifier/URIFilter/DisableExternal.php">
|
||||||
<line>8</line>
|
<line>8</line>
|
||||||
@@ -213,12 +195,12 @@
|
|||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.Base">
|
<directive id="URI.Base">
|
||||||
<file name="HTMLPurifier/URIDefinition.php">
|
<file name="HTMLPurifier/URIDefinition.php">
|
||||||
<line>65</line>
|
<line>58</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.DefaultScheme">
|
<directive id="URI.DefaultScheme">
|
||||||
<file name="HTMLPurifier/URIDefinition.php">
|
<file name="HTMLPurifier/URIDefinition.php">
|
||||||
<line>72</line>
|
<line>65</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.AllowedSchemes">
|
<directive id="URI.AllowedSchemes">
|
||||||
@@ -233,7 +215,12 @@
|
|||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.Disable">
|
<directive id="URI.Disable">
|
||||||
<file name="HTMLPurifier/AttrDef/URI.php">
|
<file name="HTMLPurifier/AttrDef/URI.php">
|
||||||
<line>28</line>
|
<line>23</line>
|
||||||
|
</file>
|
||||||
|
</directive>
|
||||||
|
<directive id="URI.Munge">
|
||||||
|
<file name="HTMLPurifier/AttrDef/URI.php">
|
||||||
|
<line>68</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="Core.ColorKeywords">
|
<directive id="Core.ColorKeywords">
|
||||||
@@ -318,17 +305,6 @@
|
|||||||
<line>123</line>
|
<line>123</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="HTML.MaxImgLength">
|
|
||||||
<file name="HTMLPurifier/HTMLModule/Image.php">
|
|
||||||
<line>14</line>
|
|
||||||
</file>
|
|
||||||
<file name="HTMLPurifier/HTMLModule/SafeEmbed.php">
|
|
||||||
<line>13</line>
|
|
||||||
</file>
|
|
||||||
<file name="HTMLPurifier/HTMLModule/SafeObject.php">
|
|
||||||
<line>19</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
<directive id="HTML.TidyLevel">
|
<directive id="HTML.TidyLevel">
|
||||||
<file name="HTMLPurifier/HTMLModule/Tidy.php">
|
<file name="HTMLPurifier/HTMLModule/Tidy.php">
|
||||||
<line>45</line>
|
<line>45</line>
|
||||||
@@ -382,14 +358,4 @@
|
|||||||
<line>8</line>
|
<line>8</line>
|
||||||
</file>
|
</file>
|
||||||
</directive>
|
</directive>
|
||||||
<directive id="URI.MungeResources">
|
|
||||||
<file name="HTMLPurifier/URIFilter/Munge.php">
|
|
||||||
<line>14</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
<directive id="URI.MungeSecretKey">
|
|
||||||
<file name="HTMLPurifier/URIFilter/Munge.php">
|
|
||||||
<line>15</line>
|
|
||||||
</file>
|
|
||||||
</directive>
|
|
||||||
</usage>
|
</usage>
|
||||||
|
@@ -130,26 +130,30 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Let's suppose I wanted to write a filter that converted links with a
|
Let's suppose I wanted to write a filter that de-internationalized domain
|
||||||
custom <code>image</code> scheme to its corresponding real path on
|
names by converting them to <a href="http://en.wikipedia.org/wiki/Punycode">Punycode</a>.
|
||||||
our website:
|
Assuming that <code>punycode_encode($input)</code> converts <code>$input</code> to
|
||||||
|
Punycode and returns <code>false</code> on failure:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>class HTMLPurifier_URIFilter_TransformImageScheme extends HTMLPurifier_URIFilter
|
<pre>class HTMLPurifier_URIFilter_ConvertIDNToPunycode extends HTMLPurifier_URIFilter
|
||||||
{
|
{
|
||||||
public $name = 'TransformImageScheme';
|
public $name = 'ConvertIDNToPunycode';
|
||||||
public function filter(&$uri, $config, $context) {
|
public function filter(&$uri, $config, $context) {
|
||||||
if ($uri->scheme !== 'image') return true;
|
if (is_null($uri->host)) return true;
|
||||||
$img_name = $uri->path;
|
if ($uri->host == utf8_decode($uri->host)) {
|
||||||
// Overwrite the previous URI object
|
// is ASCII, abort
|
||||||
$uri = new HTMLPurifier_URI('http', null, null, null, '/img/' . $img_name . '.png', null, null);
|
return true;
|
||||||
|
}
|
||||||
|
$host = punycode_encode($uri->host);
|
||||||
|
if ($host === false) return false;
|
||||||
|
$uri->host = $host;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Notice I did not <code>return $uri;</code>. This filter would turn
|
Notice I did not <code>return $uri;</code>.
|
||||||
<code>image:Foo</code> into <code>/img/Foo.png</code>.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Activating your filter</h2>
|
<h2>Activating your filter</h2>
|
||||||
@@ -182,25 +186,6 @@ $uri->registerFilter(new HTMLPurifier_URIFilter_<strong>NameOfFilter</strong>())
|
|||||||
is set to true.
|
is set to true.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Post-filter</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember our TransformImageScheme filter? That filter acted before we had
|
|
||||||
performed scheme validation; otherwise, the URI would have been filtered
|
|
||||||
out when it was discovered that there was no image scheme. Well, a post-filter
|
|
||||||
is run after scheme specific validation, so it's ideal for bulk
|
|
||||||
post-processing of URIs, including munging. To specify a URI as a post-filter,
|
|
||||||
set the <code>$post</code> member variable to TRUE.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre>class HTMLPurifier_URIFilter_MyPostFilter extends HTMLPurifier_URIFilter
|
|
||||||
{
|
|
||||||
public $name = 'MyPostFilter';
|
|
||||||
public $post = true;
|
|
||||||
// ... extra code here
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h2>Examples</h2>
|
<h2>Examples</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@@ -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.
|
@@ -1,129 +0,0 @@
|
|||||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
|
|
||||||
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
|
|
||||||
<!--[if !mso]>
|
|
||||||
<style>
|
|
||||||
v\:* {behavior:url(#default#VML);}
|
|
||||||
o\:* {behavior:url(#default#VML);}
|
|
||||||
w\:* {behavior:url(#default#VML);}
|
|
||||||
..shape {behavior:url(#default#VML);}
|
|
||||||
</style>
|
|
||||||
<![endif]-->
|
|
||||||
<style>
|
|
||||||
<!--
|
|
||||||
/* Font Definitions */
|
|
||||||
@font-face
|
|
||||||
{font-family:"Cambria Math";
|
|
||||||
panose-1:2 4 5 3 5 4 6 3 2 4;}
|
|
||||||
@font-face
|
|
||||||
{font-family:Calibri;
|
|
||||||
panose-1:2 15 5 2 2 2 4 3 2 4;}
|
|
||||||
@font-face
|
|
||||||
{font-family:Tahoma;
|
|
||||||
panose-1:2 11 6 4 3 5 4 4 2 4;}
|
|
||||||
@font-face
|
|
||||||
{font-family:Verdana;
|
|
||||||
panose-1:2 11 6 4 3 5 4 4 2 4;}
|
|
||||||
/* Style Definitions */
|
|
||||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
|
||||||
{margin:0cm;
|
|
||||||
margin-bottom:.0001pt;
|
|
||||||
font-size:10.0pt;
|
|
||||||
font-family:"Verdana","sans-serif";}
|
|
||||||
a:link, span.MsoHyperlink
|
|
||||||
{mso-style-priority:99;
|
|
||||||
color:blue;
|
|
||||||
text-decoration:underline;}
|
|
||||||
a:visited, span.MsoHyperlinkFollowed
|
|
||||||
{mso-style-priority:99;
|
|
||||||
color:purple;
|
|
||||||
text-decoration:underline;}
|
|
||||||
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
|
|
||||||
{mso-style-priority:99;
|
|
||||||
mso-style-link:"Balloon Text Char";
|
|
||||||
margin:0cm;
|
|
||||||
margin-bottom:.0001pt;
|
|
||||||
font-size:8.0pt;
|
|
||||||
font-family:"Tahoma","sans-serif";}
|
|
||||||
span.EmailStyle17
|
|
||||||
{mso-style-type:personal-compose;
|
|
||||||
font-family:"Verdana","sans-serif";
|
|
||||||
color:windowtext;}
|
|
||||||
span.BalloonTextChar
|
|
||||||
{mso-style-name:"Balloon Text Char";
|
|
||||||
mso-style-priority:99;
|
|
||||||
mso-style-link:"Balloon Text";
|
|
||||||
font-family:"Tahoma","sans-serif";}
|
|
||||||
..MsoChpDefault
|
|
||||||
{mso-style-type:export-only;}
|
|
||||||
@page Section1
|
|
||||||
{size:612.0pt 792.0pt;
|
|
||||||
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
|
|
||||||
div.Section1
|
|
||||||
{page:Section1;}
|
|
||||||
-->
|
|
||||||
</style>
|
|
||||||
<!--[if gte mso 9]><xml>
|
|
||||||
<o:shapedefaults v:ext="edit" spidmax="2050" />
|
|
||||||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
|
||||||
<o:shapelayout v:ext="edit">
|
|
||||||
<o:idmap v:ext="edit" data="1" />
|
|
||||||
</o:shapelayout></xml><![endif]-->
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body lang=NL link=blue vlink=purple>
|
|
||||||
|
|
||||||
<div class=Section1>
|
|
||||||
|
|
||||||
<p class=MsoNormal><img width=1277 height=994 id="Picture_x0020_1"
|
|
||||||
src="cid:image001.png@01C8CBDF.5D1BAEE0"><o:p></o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><o:p> </o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><b>Name<o:p></o:p></b></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal>E-mail : <a href="mailto:mail@example.com"><span
|
|
||||||
style='color:windowtext'>mail@example.com</span></a><o:p></o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><o:p> </o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><b>Company<o:p></o:p></b></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal>Address 1<o:p></o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal>Address 2<o:p></o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><o:p> </o:p></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal>Telefoon : +xx xx xxx xxx xx <span style='color:black'><o:p></o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US style='color:black'>Fax : +xx xx xxx xx xx<o:p></o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US style='color:black'>Internet : </span><span
|
|
||||||
style='color:black'><a href="http://www.example.com/"><span lang=EN-US
|
|
||||||
style='color:black'>http://www.example.com</span></a></span><span
|
|
||||||
lang=EN-US style='color:black'><o:p></o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US style='color:black'>Kamer van koophandel
|
|
||||||
xxxxxxxxx<o:p></o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US style='color:black'><o:p> </o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US style='font-size:7.5pt;color:black'>Op deze
|
|
||||||
e-mail is een disclaimer van toepassing, ga naar </span><span lang=EN-US
|
|
||||||
style='font-size:7.5pt'><a
|
|
||||||
href="http://www.example.com/disclaimer"><span
|
|
||||||
style='color:black'>www.example.com/disclaimer</span></a><br>
|
|
||||||
<span style='color:black'>A disclaimer is applicable to this email, please
|
|
||||||
refer to </span><a href="http://www.example.com/disclaimer"><span
|
|
||||||
style='color:black'>www.example.com/disclaimer</span></a><o:p></o:p></span></p>
|
|
||||||
|
|
||||||
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@@ -7,7 +7,7 @@
|
|||||||
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
|
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
|
||||||
* FILE, changes will be overwritten the next time the script is run.
|
* FILE, changes will be overwritten the next time the script is run.
|
||||||
*
|
*
|
||||||
* @version 3.1.1
|
* @version 3.1.0
|
||||||
*
|
*
|
||||||
* @warning
|
* @warning
|
||||||
* You must *not* include any other HTML Purifier files before this file,
|
* You must *not* include any other HTML Purifier files before this file,
|
||||||
@@ -29,6 +29,7 @@ require 'HTMLPurifier/Definition.php';
|
|||||||
require 'HTMLPurifier/CSSDefinition.php';
|
require 'HTMLPurifier/CSSDefinition.php';
|
||||||
require 'HTMLPurifier/ChildDef.php';
|
require 'HTMLPurifier/ChildDef.php';
|
||||||
require 'HTMLPurifier/Config.php';
|
require 'HTMLPurifier/Config.php';
|
||||||
|
require 'HTMLPurifier/ConfigDef.php';
|
||||||
require 'HTMLPurifier/ConfigSchema.php';
|
require 'HTMLPurifier/ConfigSchema.php';
|
||||||
require 'HTMLPurifier/ContentSets.php';
|
require 'HTMLPurifier/ContentSets.php';
|
||||||
require 'HTMLPurifier/Context.php';
|
require 'HTMLPurifier/Context.php';
|
||||||
@@ -51,7 +52,6 @@ require 'HTMLPurifier/IDAccumulator.php';
|
|||||||
require 'HTMLPurifier/Injector.php';
|
require 'HTMLPurifier/Injector.php';
|
||||||
require 'HTMLPurifier/Language.php';
|
require 'HTMLPurifier/Language.php';
|
||||||
require 'HTMLPurifier/LanguageFactory.php';
|
require 'HTMLPurifier/LanguageFactory.php';
|
||||||
require 'HTMLPurifier/Length.php';
|
|
||||||
require 'HTMLPurifier/Lexer.php';
|
require 'HTMLPurifier/Lexer.php';
|
||||||
require 'HTMLPurifier/PercentEncoder.php';
|
require 'HTMLPurifier/PercentEncoder.php';
|
||||||
require 'HTMLPurifier/Strategy.php';
|
require 'HTMLPurifier/Strategy.php';
|
||||||
@@ -66,14 +66,12 @@ require 'HTMLPurifier/URIFilter.php';
|
|||||||
require 'HTMLPurifier/URIParser.php';
|
require 'HTMLPurifier/URIParser.php';
|
||||||
require 'HTMLPurifier/URIScheme.php';
|
require 'HTMLPurifier/URIScheme.php';
|
||||||
require 'HTMLPurifier/URISchemeRegistry.php';
|
require 'HTMLPurifier/URISchemeRegistry.php';
|
||||||
require 'HTMLPurifier/UnitConverter.php';
|
|
||||||
require 'HTMLPurifier/VarParser.php';
|
require 'HTMLPurifier/VarParser.php';
|
||||||
require 'HTMLPurifier/VarParserException.php';
|
require 'HTMLPurifier/VarParserException.php';
|
||||||
require 'HTMLPurifier/AttrDef/CSS.php';
|
require 'HTMLPurifier/AttrDef/CSS.php';
|
||||||
require 'HTMLPurifier/AttrDef/Enum.php';
|
require 'HTMLPurifier/AttrDef/Enum.php';
|
||||||
require 'HTMLPurifier/AttrDef/Integer.php';
|
require 'HTMLPurifier/AttrDef/Integer.php';
|
||||||
require 'HTMLPurifier/AttrDef/Lang.php';
|
require 'HTMLPurifier/AttrDef/Lang.php';
|
||||||
require 'HTMLPurifier/AttrDef/Switch.php';
|
|
||||||
require 'HTMLPurifier/AttrDef/Text.php';
|
require 'HTMLPurifier/AttrDef/Text.php';
|
||||||
require 'HTMLPurifier/AttrDef/URI.php';
|
require 'HTMLPurifier/AttrDef/URI.php';
|
||||||
require 'HTMLPurifier/AttrDef/CSS/Number.php';
|
require 'HTMLPurifier/AttrDef/CSS/Number.php';
|
||||||
@@ -118,9 +116,6 @@ require 'HTMLPurifier/AttrTransform/ImgSpace.php';
|
|||||||
require 'HTMLPurifier/AttrTransform/Lang.php';
|
require 'HTMLPurifier/AttrTransform/Lang.php';
|
||||||
require 'HTMLPurifier/AttrTransform/Length.php';
|
require 'HTMLPurifier/AttrTransform/Length.php';
|
||||||
require 'HTMLPurifier/AttrTransform/Name.php';
|
require 'HTMLPurifier/AttrTransform/Name.php';
|
||||||
require 'HTMLPurifier/AttrTransform/SafeEmbed.php';
|
|
||||||
require 'HTMLPurifier/AttrTransform/SafeObject.php';
|
|
||||||
require 'HTMLPurifier/AttrTransform/SafeParam.php';
|
|
||||||
require 'HTMLPurifier/AttrTransform/ScriptRequired.php';
|
require 'HTMLPurifier/AttrTransform/ScriptRequired.php';
|
||||||
require 'HTMLPurifier/ChildDef/Chameleon.php';
|
require 'HTMLPurifier/ChildDef/Chameleon.php';
|
||||||
require 'HTMLPurifier/ChildDef/Custom.php';
|
require 'HTMLPurifier/ChildDef/Custom.php';
|
||||||
@@ -129,6 +124,9 @@ require 'HTMLPurifier/ChildDef/Required.php';
|
|||||||
require 'HTMLPurifier/ChildDef/Optional.php';
|
require 'HTMLPurifier/ChildDef/Optional.php';
|
||||||
require 'HTMLPurifier/ChildDef/StrictBlockquote.php';
|
require 'HTMLPurifier/ChildDef/StrictBlockquote.php';
|
||||||
require 'HTMLPurifier/ChildDef/Table.php';
|
require 'HTMLPurifier/ChildDef/Table.php';
|
||||||
|
require 'HTMLPurifier/ConfigDef/Directive.php';
|
||||||
|
require 'HTMLPurifier/ConfigDef/DirectiveAlias.php';
|
||||||
|
require 'HTMLPurifier/ConfigDef/Namespace.php';
|
||||||
require 'HTMLPurifier/DefinitionCache/Decorator.php';
|
require 'HTMLPurifier/DefinitionCache/Decorator.php';
|
||||||
require 'HTMLPurifier/DefinitionCache/Null.php';
|
require 'HTMLPurifier/DefinitionCache/Null.php';
|
||||||
require 'HTMLPurifier/DefinitionCache/Serializer.php';
|
require 'HTMLPurifier/DefinitionCache/Serializer.php';
|
||||||
@@ -146,8 +144,6 @@ require 'HTMLPurifier/HTMLModule/Object.php';
|
|||||||
require 'HTMLPurifier/HTMLModule/Presentation.php';
|
require 'HTMLPurifier/HTMLModule/Presentation.php';
|
||||||
require 'HTMLPurifier/HTMLModule/Proprietary.php';
|
require 'HTMLPurifier/HTMLModule/Proprietary.php';
|
||||||
require 'HTMLPurifier/HTMLModule/Ruby.php';
|
require 'HTMLPurifier/HTMLModule/Ruby.php';
|
||||||
require 'HTMLPurifier/HTMLModule/SafeEmbed.php';
|
|
||||||
require 'HTMLPurifier/HTMLModule/SafeObject.php';
|
|
||||||
require 'HTMLPurifier/HTMLModule/Scripting.php';
|
require 'HTMLPurifier/HTMLModule/Scripting.php';
|
||||||
require 'HTMLPurifier/HTMLModule/StyleAttribute.php';
|
require 'HTMLPurifier/HTMLModule/StyleAttribute.php';
|
||||||
require 'HTMLPurifier/HTMLModule/Tables.php';
|
require 'HTMLPurifier/HTMLModule/Tables.php';
|
||||||
@@ -163,7 +159,6 @@ require 'HTMLPurifier/HTMLModule/Tidy/XHTML.php';
|
|||||||
require 'HTMLPurifier/Injector/AutoParagraph.php';
|
require 'HTMLPurifier/Injector/AutoParagraph.php';
|
||||||
require 'HTMLPurifier/Injector/Linkify.php';
|
require 'HTMLPurifier/Injector/Linkify.php';
|
||||||
require 'HTMLPurifier/Injector/PurifierLinkify.php';
|
require 'HTMLPurifier/Injector/PurifierLinkify.php';
|
||||||
require 'HTMLPurifier/Injector/SafeObject.php';
|
|
||||||
require 'HTMLPurifier/Lexer/DOMLex.php';
|
require 'HTMLPurifier/Lexer/DOMLex.php';
|
||||||
require 'HTMLPurifier/Lexer/DirectLex.php';
|
require 'HTMLPurifier/Lexer/DirectLex.php';
|
||||||
require 'HTMLPurifier/Strategy/Composite.php';
|
require 'HTMLPurifier/Strategy/Composite.php';
|
||||||
@@ -184,7 +179,6 @@ require 'HTMLPurifier/URIFilter/DisableExternal.php';
|
|||||||
require 'HTMLPurifier/URIFilter/DisableExternalResources.php';
|
require 'HTMLPurifier/URIFilter/DisableExternalResources.php';
|
||||||
require 'HTMLPurifier/URIFilter/HostBlacklist.php';
|
require 'HTMLPurifier/URIFilter/HostBlacklist.php';
|
||||||
require 'HTMLPurifier/URIFilter/MakeAbsolute.php';
|
require 'HTMLPurifier/URIFilter/MakeAbsolute.php';
|
||||||
require 'HTMLPurifier/URIFilter/Munge.php';
|
|
||||||
require 'HTMLPurifier/URIScheme/ftp.php';
|
require 'HTMLPurifier/URIScheme/ftp.php';
|
||||||
require 'HTMLPurifier/URIScheme/http.php';
|
require 'HTMLPurifier/URIScheme/http.php';
|
||||||
require 'HTMLPurifier/URIScheme/https.php';
|
require 'HTMLPurifier/URIScheme/https.php';
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
HTML Purifier 3.1.1 - Standards Compliant HTML Filtering
|
HTML Purifier 3.1.0 - Standards Compliant HTML Filtering
|
||||||
Copyright (C) 2006-2008 Edward Z. Yang
|
Copyright (C) 2006-2008 Edward Z. Yang
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
@@ -55,10 +55,10 @@ class HTMLPurifier
|
|||||||
{
|
{
|
||||||
|
|
||||||
/** Version of HTML Purifier */
|
/** Version of HTML Purifier */
|
||||||
public $version = '3.1.1';
|
public $version = '3.1.0';
|
||||||
|
|
||||||
/** Constant with version of HTML Purifier */
|
/** Constant with version of HTML Purifier */
|
||||||
const VERSION = '3.1.1';
|
const VERSION = '3.1.0';
|
||||||
|
|
||||||
/** Global configuration object */
|
/** Global configuration object */
|
||||||
public $config;
|
public $config;
|
||||||
|
@@ -1,189 +1,183 @@
|
|||||||
<?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/ConfigDef.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ContentSets.php';
|
require_once $__dir . '/HTMLPurifier/ConfigSchema.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Context.php';
|
require_once $__dir . '/HTMLPurifier/ContentSets.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache.php';
|
require_once $__dir . '/HTMLPurifier/Context.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Doctype.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php';
|
require_once $__dir . '/HTMLPurifier/Doctype.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ElementDef.php';
|
require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Encoder.php';
|
require_once $__dir . '/HTMLPurifier/ElementDef.php';
|
||||||
require_once $__dir . '/HTMLPurifier/EntityLookup.php';
|
require_once $__dir . '/HTMLPurifier/Encoder.php';
|
||||||
require_once $__dir . '/HTMLPurifier/EntityParser.php';
|
require_once $__dir . '/HTMLPurifier/EntityLookup.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ErrorCollector.php';
|
require_once $__dir . '/HTMLPurifier/EntityParser.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Exception.php';
|
require_once $__dir . '/HTMLPurifier/ErrorCollector.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Filter.php';
|
require_once $__dir . '/HTMLPurifier/Exception.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Generator.php';
|
require_once $__dir . '/HTMLPurifier/Filter.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLDefinition.php';
|
require_once $__dir . '/HTMLPurifier/Generator.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule.php';
|
require_once $__dir . '/HTMLPurifier/HTMLDefinition.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule.php';
|
||||||
require_once $__dir . '/HTMLPurifier/IDAccumulator.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Injector.php';
|
require_once $__dir . '/HTMLPurifier/IDAccumulator.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Language.php';
|
require_once $__dir . '/HTMLPurifier/Injector.php';
|
||||||
require_once $__dir . '/HTMLPurifier/LanguageFactory.php';
|
require_once $__dir . '/HTMLPurifier/Language.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Length.php';
|
require_once $__dir . '/HTMLPurifier/LanguageFactory.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/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/Text.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/Switch.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/Text.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php';
|
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php';
|
require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeEmbed.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeObject.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeParam.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Required.php';
|
||||||
require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php';
|
require_once $__dir . '/HTMLPurifier/ChildDef/Table.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php';
|
require_once $__dir . '/HTMLPurifier/ConfigDef/Directive.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Required.php';
|
require_once $__dir . '/HTMLPurifier/ConfigDef/DirectiveAlias.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php';
|
require_once $__dir . '/HTMLPurifier/ConfigDef/Namespace.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php';
|
||||||
require_once $__dir . '/HTMLPurifier/ChildDef/Table.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php';
|
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php';
|
||||||
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeEmbed.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeObject.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
|
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
|
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php';
|
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php';
|
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
|
||||||
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
|
require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
|
require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/Composite.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/Core.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/Composite.php';
|
require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/Core.php';
|
require_once $__dir . '/HTMLPurifier/TagTransform/Font.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php';
|
require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php';
|
require_once $__dir . '/HTMLPurifier/Token/Comment.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php';
|
require_once $__dir . '/HTMLPurifier/Token/Tag.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php';
|
require_once $__dir . '/HTMLPurifier/Token/Empty.php';
|
||||||
require_once $__dir . '/HTMLPurifier/TagTransform/Font.php';
|
require_once $__dir . '/HTMLPurifier/Token/End.php';
|
||||||
require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php';
|
require_once $__dir . '/HTMLPurifier/Token/Start.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/Comment.php';
|
require_once $__dir . '/HTMLPurifier/Token/Text.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/Tag.php';
|
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/Empty.php';
|
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/End.php';
|
require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/Start.php';
|
require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php';
|
||||||
require_once $__dir . '/HTMLPurifier/Token/Text.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/http.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/https.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/news.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIFilter/Munge.php';
|
require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php';
|
require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/http.php';
|
require_once $__dir . '/HTMLPurifier/VarParser/Native.php';
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/https.php';
|
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php';
|
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/news.php';
|
|
||||||
require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php';
|
|
||||||
require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php';
|
|
||||||
require_once $__dir . '/HTMLPurifier/VarParser/Native.php';
|
|
||||||
|
@@ -51,13 +51,16 @@ abstract class HTMLPurifier_AttrDef
|
|||||||
*
|
*
|
||||||
* @warning This processing is inconsistent with XML's whitespace handling
|
* @warning This processing is inconsistent with XML's whitespace handling
|
||||||
* as specified by section 3.3.3 and referenced XHTML 1.0 section
|
* as specified by section 3.3.3 and referenced XHTML 1.0 section
|
||||||
* 4.7. However, note that we are NOT necessarily
|
* 4.7. Compliant processing requires all line breaks normalized
|
||||||
* parsing XML, thus, this behavior may still be correct. We
|
* to "\n", so the fix is not as simple as fixing it in this
|
||||||
* assume that newlines have been normalized.
|
* function. Trim and whitespace collapsing are supposed to only
|
||||||
|
* occur in NMTOKENs. However, note that we are NOT necessarily
|
||||||
|
* parsing XML, thus, this behavior may still be correct.
|
||||||
*/
|
*/
|
||||||
public function parseCDATA($string) {
|
public function parseCDATA($string) {
|
||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
$string = str_replace(array("\n", "\t", "\r"), ' ', $string);
|
$string = str_replace("\n", '', $string);
|
||||||
|
$string = str_replace(array("\r", "\t"), ' ', $string);
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,12 +29,6 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
|
|||||||
$declarations = explode(';', $css);
|
$declarations = explode(';', $css);
|
||||||
$propvalues = array();
|
$propvalues = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* Name of the current CSS property being validated.
|
|
||||||
*/
|
|
||||||
$property = false;
|
|
||||||
$context->register('CurrentCSSProperty', $property);
|
|
||||||
|
|
||||||
foreach ($declarations as $declaration) {
|
foreach ($declarations as $declaration) {
|
||||||
if (!$declaration) continue;
|
if (!$declaration) continue;
|
||||||
if (!strpos($declaration, ':')) continue;
|
if (!strpos($declaration, ':')) continue;
|
||||||
@@ -67,8 +61,6 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
|
|||||||
$propvalues[$property] = $result;
|
$propvalues[$property] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$context->destroy('CurrentCSSProperty');
|
|
||||||
|
|
||||||
// procedure does not write the new CSS simultaneously, so it's
|
// procedure does not write the new CSS simultaneously, so it's
|
||||||
// slightly inefficient, but it's the only way of getting rid of
|
// slightly inefficient, but it's the only way of getting rid of
|
||||||
// duplicates. Perhaps config to optimize it, but not now.
|
// duplicates. Perhaps config to optimize it, but not now.
|
||||||
|
@@ -16,6 +16,7 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
|
|||||||
'cursive' => true
|
'cursive' => true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$string = $this->parseCDATA($string);
|
||||||
// assume that no font names contain commas in them
|
// assume that no font names contain commas in them
|
||||||
$fonts = explode(',', $string);
|
$fonts = explode(',', $string);
|
||||||
$final = '';
|
$final = '';
|
||||||
@@ -34,40 +35,13 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
|
|||||||
$quote = $font[0];
|
$quote = $font[0];
|
||||||
if ($font[$length - 1] !== $quote) continue;
|
if ($font[$length - 1] !== $quote) continue;
|
||||||
$font = substr($font, 1, $length - 2);
|
$font = substr($font, 1, $length - 2);
|
||||||
|
// double-backslash processing is buggy
|
||||||
$new_font = '';
|
$font = str_replace("\\$quote", $quote, $font); // de-escape quote
|
||||||
for ($i = 0, $c = strlen($font); $i < $c; $i++) {
|
$font = str_replace("\\\n", "\n", $font); // de-escape newlines
|
||||||
if ($font[$i] === '\\') {
|
|
||||||
$i++;
|
|
||||||
if ($i >= $c) {
|
|
||||||
$new_font .= '\\';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (ctype_xdigit($font[$i])) {
|
|
||||||
$code = $font[$i];
|
|
||||||
for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
|
|
||||||
if (!ctype_xdigit($font[$i])) break;
|
|
||||||
$code .= $font[$i];
|
|
||||||
}
|
|
||||||
// We have to be extremely careful when adding
|
|
||||||
// new characters, to make sure we're not breaking
|
|
||||||
// the encoding.
|
|
||||||
$char = HTMLPurifier_Encoder::unichr(hexdec($code));
|
|
||||||
if (HTMLPurifier_Encoder::cleanUTF8($char) === '') continue;
|
|
||||||
$new_font .= $char;
|
|
||||||
if ($i < $c && trim($font[$i]) !== '') $i--;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($font[$i] === "\n") continue;
|
|
||||||
}
|
|
||||||
$new_font .= $font[$i];
|
|
||||||
}
|
|
||||||
|
|
||||||
$font = $new_font;
|
|
||||||
}
|
}
|
||||||
// $font is a pure representation of the font name
|
// $font is a pure representation of the font name
|
||||||
|
|
||||||
if (ctype_alnum($font) && $font !== '') {
|
if (ctype_alnum($font)) {
|
||||||
// very simple font, allow it in unharmed
|
// very simple font, allow it in unharmed
|
||||||
$final .= $font . ', ';
|
$final .= $font . ', ';
|
||||||
continue;
|
continue;
|
||||||
@@ -76,8 +50,8 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
|
|||||||
// complicated font, requires quoting
|
// complicated font, requires quoting
|
||||||
|
|
||||||
// armor single quotes and new lines
|
// armor single quotes and new lines
|
||||||
$font = str_replace("\\", "\\\\", $font);
|
|
||||||
$font = str_replace("'", "\\'", $font);
|
$font = str_replace("'", "\\'", $font);
|
||||||
|
$font = str_replace("\n", "\\\n", $font);
|
||||||
$final .= "'$font', ";
|
$final .= "'$font', ";
|
||||||
}
|
}
|
||||||
$final = rtrim($final, ', ');
|
$final = rtrim($final, ', ');
|
||||||
|
@@ -6,40 +6,46 @@
|
|||||||
class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef
|
class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $min, $max;
|
/**
|
||||||
|
* Valid unit lookup table.
|
||||||
|
* @warning The code assumes all units are two characters long. Be careful
|
||||||
|
* if we have to change this behavior!
|
||||||
|
*/
|
||||||
|
protected $units = array('em' => true, 'ex' => true, 'px' => true, 'in' => true,
|
||||||
|
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true);
|
||||||
|
/**
|
||||||
|
* Instance of HTMLPurifier_AttrDef_Number to defer number validation to
|
||||||
|
*/
|
||||||
|
protected $number_def;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_Length $max Minimum length, or null for no bound. String is also acceptable.
|
* @param $non_negative Bool indication whether or not negative values are
|
||||||
* @param HTMLPurifier_Length $max Maximum length, or null for no bound. String is also acceptable.
|
* allowed.
|
||||||
*/
|
*/
|
||||||
public function __construct($min = null, $max = null) {
|
public function __construct($non_negative = false) {
|
||||||
$this->min = $min !== null ? HTMLPurifier_Length::make($min) : null;
|
$this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative);
|
||||||
$this->max = $max !== null ? HTMLPurifier_Length::make($max) : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validate($string, $config, $context) {
|
public function validate($length, $config, $context) {
|
||||||
$string = $this->parseCDATA($string);
|
|
||||||
|
|
||||||
// Optimizations
|
$length = $this->parseCDATA($length);
|
||||||
if ($string === '') return false;
|
if ($length === '') return false;
|
||||||
if ($string === '0') return '0';
|
if ($length === '0') return '0';
|
||||||
if (strlen($string) === 1) return false;
|
$strlen = strlen($length);
|
||||||
|
if ($strlen === 1) return false; // impossible!
|
||||||
|
|
||||||
$length = HTMLPurifier_Length::make($string);
|
// we assume all units are two characters
|
||||||
if (!$length->isValid()) return false;
|
$unit = substr($length, $strlen - 2);
|
||||||
|
if (!ctype_lower($unit)) $unit = strtolower($unit);
|
||||||
|
$number = substr($length, 0, $strlen - 2);
|
||||||
|
|
||||||
if ($this->min) {
|
if (!isset($this->units[$unit])) return false;
|
||||||
$c = $length->compareTo($this->min);
|
|
||||||
if ($c === false) return false;
|
$number = $this->number_def->validate($number, $config, $context);
|
||||||
if ($c < 0) return false;
|
if ($number === false) return false;
|
||||||
}
|
|
||||||
if ($this->max) {
|
return $number . $unit;
|
||||||
$c = $length->compareTo($this->max);
|
|
||||||
if ($c === false) return false;
|
|
||||||
if ($c > 0) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $length->toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -18,10 +18,6 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef
|
|||||||
$this->non_negative = $non_negative;
|
$this->non_negative = $non_negative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @warning Some contexts do not pass $config, $context. These
|
|
||||||
* variables should not be used without checking HTMLPurifier_Length
|
|
||||||
*/
|
|
||||||
public function validate($number, $config, $context) {
|
public function validate($number, $config, $context) {
|
||||||
|
|
||||||
$number = $this->parseCDATA($number);
|
$number = $this->parseCDATA($number);
|
||||||
|
@@ -13,13 +13,10 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
|
|||||||
static $allowed_values = array(
|
static $allowed_values = array(
|
||||||
'line-through' => true,
|
'line-through' => true,
|
||||||
'overline' => true,
|
'overline' => true,
|
||||||
'underline' => true,
|
'underline' => true
|
||||||
);
|
);
|
||||||
|
|
||||||
$string = strtolower($this->parseCDATA($string));
|
$string = strtolower($this->parseCDATA($string));
|
||||||
|
|
||||||
if ($string === 'none') return $string;
|
|
||||||
|
|
||||||
$parts = explode(' ', $string);
|
$parts = explode(' ', $string);
|
||||||
$final = '';
|
$final = '';
|
||||||
foreach ($parts as $part) {
|
foreach ($parts as $part) {
|
||||||
|
@@ -6,12 +6,6 @@
|
|||||||
class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef
|
class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $max;
|
|
||||||
|
|
||||||
public function __construct($max = null) {
|
|
||||||
$this->max = $max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validate($string, $config, $context) {
|
public function validate($string, $config, $context) {
|
||||||
|
|
||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
@@ -30,18 +24,11 @@ class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef
|
|||||||
// crash operating systems, see <http://ha.ckers.org/imagecrash.html>
|
// crash operating systems, see <http://ha.ckers.org/imagecrash.html>
|
||||||
// WARNING, above link WILL crash you if you're using Windows
|
// WARNING, above link WILL crash you if you're using Windows
|
||||||
|
|
||||||
if ($this->max !== null && $int > $this->max) return (string) $this->max;
|
if ($int > 1200) return '1200';
|
||||||
|
|
||||||
return (string) $int;
|
return (string) $int;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function make($string) {
|
|
||||||
if ($string === '') $max = null;
|
|
||||||
else $max = (int) $string;
|
|
||||||
$class = get_class($this);
|
|
||||||
return new $class($max);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decorator that, depending on a token, switches between two definitions.
|
|
||||||
*/
|
|
||||||
class HTMLPurifier_AttrDef_Switch
|
|
||||||
{
|
|
||||||
|
|
||||||
protected $tag;
|
|
||||||
protected $withTag, $withoutTag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $tag Tag name to switch upon
|
|
||||||
* @param HTMLPurifier_AttrDef $with_tag Call if token matches tag
|
|
||||||
* @param HTMLPurifier_AttrDef $without_tag Call if token doesn't match, or there is no token
|
|
||||||
*/
|
|
||||||
public function __construct($tag, $with_tag, $without_tag) {
|
|
||||||
$this->tag = $tag;
|
|
||||||
$this->withTag = $with_tag;
|
|
||||||
$this->withoutTag = $without_tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validate($string, $config, $context) {
|
|
||||||
$token = $context->get('CurrentToken', true);
|
|
||||||
if (!$token || $token->name !== $this->tag) {
|
|
||||||
return $this->withoutTag->validate($string, $config, $context);
|
|
||||||
} else {
|
|
||||||
return $this->withTag->validate($string, $config, $context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -18,11 +18,6 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
|
|||||||
$this->embedsResource = (bool) $embeds_resource;
|
$this->embedsResource = (bool) $embeds_resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function make($string) {
|
|
||||||
$embeds = (bool) $string;
|
|
||||||
return new HTMLPurifier_AttrDef_URI($embeds);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validate($uri, $config, $context) {
|
public function validate($uri, $config, $context) {
|
||||||
|
|
||||||
if ($config->get('URI', 'Disable')) return false;
|
if ($config->get('URI', 'Disable')) return false;
|
||||||
@@ -55,10 +50,6 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
|
|||||||
$result = $scheme_obj->validate($uri, $config, $context);
|
$result = $scheme_obj->validate($uri, $config, $context);
|
||||||
if (!$result) break;
|
if (!$result) break;
|
||||||
|
|
||||||
// Post chained filtering
|
|
||||||
$result = $uri_def->postFilter($uri, $config, $context);
|
|
||||||
if (!$result) break;
|
|
||||||
|
|
||||||
// survived gauntlet
|
// survived gauntlet
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
@@ -68,7 +59,18 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
|
|||||||
if (!$ok) return false;
|
if (!$ok) return false;
|
||||||
|
|
||||||
// back to string
|
// back to string
|
||||||
return $uri->toString();
|
$result = $uri->toString();
|
||||||
|
|
||||||
|
// munge entire URI if necessary
|
||||||
|
if (
|
||||||
|
!is_null($uri->host) && // indicator for authority
|
||||||
|
!empty($scheme_obj->browsable) &&
|
||||||
|
!is_null($munge = $config->get('URI', 'Munge'))
|
||||||
|
) {
|
||||||
|
$result = str_replace('%s', rawurlencode($result), $munge);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class HTMLPurifier_AttrTransform_SafeEmbed extends HTMLPurifier_AttrTransform
|
|
||||||
{
|
|
||||||
public $name = "SafeEmbed";
|
|
||||||
|
|
||||||
public function transform($attr, $config, $context) {
|
|
||||||
$attr['allowscriptaccess'] = 'never';
|
|
||||||
$attr['allownetworking'] = 'internal';
|
|
||||||
$attr['type'] = 'application/x-shockwave-flash';
|
|
||||||
return $attr;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes default type for all objects. Currently only supports flash.
|
|
||||||
*/
|
|
||||||
class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTransform
|
|
||||||
{
|
|
||||||
public $name = "SafeObject";
|
|
||||||
|
|
||||||
function transform($attr, $config, $context) {
|
|
||||||
if (!isset($attr['type'])) $attr['type'] = 'application/x-shockwave-flash';
|
|
||||||
return $attr;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,48 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validates name/value pairs in param tags to be used in safe objects. This
|
|
||||||
* will only allow name values it recognizes, and pre-fill certain attributes
|
|
||||||
* with required values.
|
|
||||||
*
|
|
||||||
* @note
|
|
||||||
* This class only supports Flash. In the future, Quicktime support
|
|
||||||
* may be added.
|
|
||||||
*
|
|
||||||
* @warning
|
|
||||||
* This class expects an injector to add the necessary parameters tags.
|
|
||||||
*/
|
|
||||||
class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTransform
|
|
||||||
{
|
|
||||||
public $name = "SafeParam";
|
|
||||||
private $uri;
|
|
||||||
|
|
||||||
public function __construct() {
|
|
||||||
$this->uri = new HTMLPurifier_AttrDef_URI(true); // embedded
|
|
||||||
}
|
|
||||||
|
|
||||||
public function transform($attr, $config, $context) {
|
|
||||||
// If we add support for other objects, we'll need to alter the
|
|
||||||
// transforms.
|
|
||||||
switch ($attr['name']) {
|
|
||||||
// application/x-shockwave-flash
|
|
||||||
// Keep this synchronized with Injector/SafeObject.php
|
|
||||||
case 'allowScriptAccess':
|
|
||||||
$attr['value'] = 'never';
|
|
||||||
break;
|
|
||||||
case 'allowNetworking':
|
|
||||||
$attr['value'] = 'internal';
|
|
||||||
break;
|
|
||||||
case 'wmode':
|
|
||||||
$attr['value'] = 'window';
|
|
||||||
break;
|
|
||||||
case 'movie':
|
|
||||||
$attr['value'] = $this->uri->validate($attr['value'], $config, $context);
|
|
||||||
break;
|
|
||||||
// add other cases to support other param name/value pairs
|
|
||||||
default:
|
|
||||||
$attr['name'] = $attr['value'] = null;
|
|
||||||
}
|
|
||||||
return $attr;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -43,8 +43,8 @@ class HTMLPurifier_AttrValidator
|
|||||||
// DEFINITION CALL
|
// DEFINITION CALL
|
||||||
$d_defs = $definition->info_global_attr;
|
$d_defs = $definition->info_global_attr;
|
||||||
|
|
||||||
// don't update token until the very end, to ensure an atomic update
|
// reference attributes for easy manipulation
|
||||||
$attr = $token->attr;
|
$attr =& $token->attr;
|
||||||
|
|
||||||
// do global transformations (pre)
|
// do global transformations (pre)
|
||||||
// nothing currently utilizes this
|
// nothing currently utilizes this
|
||||||
@@ -139,8 +139,6 @@ class HTMLPurifier_AttrValidator
|
|||||||
if ($e && ($attr != $o)) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr);
|
if ($e && ($attr != $o)) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
$token->attr = $attr;
|
|
||||||
|
|
||||||
// destroy CurrentToken if we made it ourselves
|
// destroy CurrentToken if we made it ourselves
|
||||||
if (!$current_token) $context->destroy('CurrentToken');
|
if (!$current_token) $context->destroy('CurrentToken');
|
||||||
|
|
||||||
|
@@ -90,7 +90,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
|||||||
$this->info['border-left-width'] =
|
$this->info['border-left-width'] =
|
||||||
$this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
$this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
||||||
new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')),
|
new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')),
|
||||||
new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative
|
new HTMLPurifier_AttrDef_CSS_Length(true) //disallow negative
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width);
|
$this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width);
|
||||||
@@ -116,7 +116,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
|||||||
$this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
$this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
||||||
new HTMLPurifier_AttrDef_Enum(array('normal')),
|
new HTMLPurifier_AttrDef_Enum(array('normal')),
|
||||||
new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives
|
new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives
|
||||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
new HTMLPurifier_AttrDef_CSS_Length(true),
|
||||||
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
|||||||
$this->info['padding-bottom'] =
|
$this->info['padding-bottom'] =
|
||||||
$this->info['padding-left'] =
|
$this->info['padding-left'] =
|
||||||
$this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
$this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
||||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
new HTMLPurifier_AttrDef_CSS_Length(true),
|
||||||
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -149,26 +149,14 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
|||||||
new HTMLPurifier_AttrDef_CSS_Percentage()
|
new HTMLPurifier_AttrDef_CSS_Percentage()
|
||||||
));
|
));
|
||||||
|
|
||||||
$trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(array(
|
|
||||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
|
||||||
new HTMLPurifier_AttrDef_CSS_Percentage(true),
|
|
||||||
new HTMLPurifier_AttrDef_Enum(array('auto'))
|
|
||||||
));
|
|
||||||
$max = $config->get('CSS', 'MaxImgLength');
|
|
||||||
|
|
||||||
$this->info['width'] =
|
$this->info['width'] =
|
||||||
$this->info['height'] =
|
$this->info['height'] =
|
||||||
$max === null ?
|
new HTMLPurifier_AttrDef_CSS_DenyElementDecorator(
|
||||||
$trusted_wh :
|
new HTMLPurifier_AttrDef_CSS_Composite(array(
|
||||||
new HTMLPurifier_AttrDef_Switch('img',
|
new HTMLPurifier_AttrDef_CSS_Length(true),
|
||||||
// For img tags:
|
new HTMLPurifier_AttrDef_CSS_Percentage(true),
|
||||||
new HTMLPurifier_AttrDef_CSS_Composite(array(
|
new HTMLPurifier_AttrDef_Enum(array('auto'))
|
||||||
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
|
)), 'img');
|
||||||
new HTMLPurifier_AttrDef_Enum(array('auto'))
|
|
||||||
)),
|
|
||||||
// For everyone else:
|
|
||||||
$trusted_wh
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
|
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
|
||||||
|
|
||||||
|
@@ -55,7 +55,10 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
|
|||||||
$escape_invalid_children = $config->get('Core', 'EscapeInvalidChildren');
|
$escape_invalid_children = $config->get('Core', 'EscapeInvalidChildren');
|
||||||
|
|
||||||
// generator
|
// generator
|
||||||
$gen = new HTMLPurifier_Generator($config, $context);
|
static $gen = null;
|
||||||
|
if ($gen === null) {
|
||||||
|
$gen = new HTMLPurifier_Generator();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($tokens_of_children as $token) {
|
foreach ($tokens_of_children as $token) {
|
||||||
if (!empty($token->is_whitespace)) {
|
if (!empty($token->is_whitespace)) {
|
||||||
@@ -80,7 +83,7 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
|
|||||||
$result[] = $token;
|
$result[] = $token;
|
||||||
} elseif ($pcdata_allowed && $escape_invalid_children) {
|
} elseif ($pcdata_allowed && $escape_invalid_children) {
|
||||||
$result[] = new HTMLPurifier_Token_Text(
|
$result[] = new HTMLPurifier_Token_Text(
|
||||||
$gen->generateFromToken($token)
|
$gen->generateFromToken($token, $config)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -91,7 +94,7 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
|
|||||||
} elseif ($pcdata_allowed && $escape_invalid_children) {
|
} elseif ($pcdata_allowed && $escape_invalid_children) {
|
||||||
$result[] =
|
$result[] =
|
||||||
new HTMLPurifier_Token_Text(
|
new HTMLPurifier_Token_Text(
|
||||||
$gen->generateFromToken($token)
|
$gen->generateFromToken( $token, $config )
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// drop silently
|
// drop silently
|
||||||
|
@@ -20,7 +20,7 @@ class HTMLPurifier_Config
|
|||||||
/**
|
/**
|
||||||
* HTML Purifier's version
|
* HTML Purifier's version
|
||||||
*/
|
*/
|
||||||
public $version = '3.1.1';
|
public $version = '3.1.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bool indicator whether or not to automatically finalize
|
* Bool indicator whether or not to automatically finalize
|
||||||
@@ -125,7 +125,7 @@ class HTMLPurifier_Config
|
|||||||
E_USER_WARNING);
|
E_USER_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isset($this->def->info[$namespace][$key]->isAlias)) {
|
if ($this->def->info[$namespace][$key]->class == 'alias') {
|
||||||
$d = $this->def->info[$namespace][$key];
|
$d = $this->def->info[$namespace][$key];
|
||||||
trigger_error('Cannot get value from aliased directive, use real name ' . $d->namespace . '.' . $d->name,
|
trigger_error('Cannot get value from aliased directive, use real name ' . $d->namespace . '.' . $d->name,
|
||||||
E_USER_ERROR);
|
E_USER_ERROR);
|
||||||
@@ -196,48 +196,40 @@ class HTMLPurifier_Config
|
|||||||
E_USER_WARNING);
|
E_USER_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$def = $this->def->info[$namespace][$key];
|
if ($this->def->info[$namespace][$key]->class == 'alias') {
|
||||||
|
|
||||||
if (isset($def->isAlias)) {
|
|
||||||
if ($from_alias) {
|
if ($from_alias) {
|
||||||
trigger_error('Double-aliases not allowed, please fix '.
|
trigger_error('Double-aliases not allowed, please fix '.
|
||||||
'ConfigSchema bug with' . "$namespace.$key", E_USER_ERROR);
|
'ConfigSchema bug with' . "$namespace.$key", E_USER_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->set($new_ns = $def->namespace,
|
$this->set($new_ns = $this->def->info[$namespace][$key]->namespace,
|
||||||
$new_dir = $def->name,
|
$new_dir = $this->def->info[$namespace][$key]->name,
|
||||||
$value, true);
|
$value, true);
|
||||||
trigger_error("$namespace.$key is an alias, preferred directive name is $new_ns.$new_dir", E_USER_NOTICE);
|
trigger_error("$namespace.$key is an alias, preferred directive name is $new_ns.$new_dir", E_USER_NOTICE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Raw type might be negative when using the fully optimized form
|
|
||||||
// of stdclass, which indicates allow_null == true
|
|
||||||
$rtype = is_int($def) ? $def : $def->type;
|
|
||||||
if ($rtype < 0) {
|
|
||||||
$type = -$rtype;
|
|
||||||
$allow_null = true;
|
|
||||||
} else {
|
|
||||||
$type = $rtype;
|
|
||||||
$allow_null = isset($def->allow_null);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$value = $this->parser->parse($value, $type, $allow_null);
|
$value = $this->parser->parse(
|
||||||
|
$value,
|
||||||
|
$type = $this->def->info[$namespace][$key]->type,
|
||||||
|
$this->def->info[$namespace][$key]->allow_null
|
||||||
|
);
|
||||||
} catch (HTMLPurifier_VarParserException $e) {
|
} catch (HTMLPurifier_VarParserException $e) {
|
||||||
trigger_error('Value for ' . "$namespace.$key" . ' is of invalid type, should be ' . HTMLPurifier_VarParser::getTypeName($type), E_USER_WARNING);
|
trigger_error('Value for ' . "$namespace.$key" . ' is of invalid type, should be ' . $type, E_USER_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is_string($value) && is_object($def)) {
|
if (is_string($value)) {
|
||||||
// resolve value alias if defined
|
// resolve value alias if defined
|
||||||
if (isset($def->aliases[$value])) {
|
if (isset($this->def->info[$namespace][$key]->aliases[$value])) {
|
||||||
$value = $def->aliases[$value];
|
$value = $this->def->info[$namespace][$key]->aliases[$value];
|
||||||
}
|
}
|
||||||
// check to see if the value is allowed
|
if ($this->def->info[$namespace][$key]->allowed !== true) {
|
||||||
if (isset($def->allowed) && !isset($def->allowed[$value])) {
|
// check to see if the value is allowed
|
||||||
trigger_error('Value not supported, valid values are: ' .
|
if (!isset($this->def->info[$namespace][$key]->allowed[$value])) {
|
||||||
$this->_listify($def->allowed), E_USER_WARNING);
|
trigger_error('Value not supported, valid values are: ' .
|
||||||
return;
|
$this->_listify($this->def->info[$namespace][$key]->allowed), E_USER_WARNING);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->conf[$namespace][$key] = $value;
|
$this->conf[$namespace][$key] = $value;
|
||||||
@@ -394,7 +386,7 @@ class HTMLPurifier_Config
|
|||||||
if (isset($blacklisted_directives["$ns.$directive"])) continue;
|
if (isset($blacklisted_directives["$ns.$directive"])) continue;
|
||||||
if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) continue;
|
if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) continue;
|
||||||
}
|
}
|
||||||
if (isset($def->isAlias)) continue;
|
if ($def->class == 'alias') continue;
|
||||||
if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') continue;
|
if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') continue;
|
||||||
$ret[] = array($ns, $directive);
|
$ret[] = array($ns, $directive);
|
||||||
}
|
}
|
||||||
|
9
library/HTMLPurifier/ConfigDef.php
Normal file
9
library/HTMLPurifier/ConfigDef.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for configuration entity
|
||||||
|
*/
|
||||||
|
abstract class HTMLPurifier_ConfigDef {
|
||||||
|
public $class = false;
|
||||||
|
}
|
||||||
|
|
55
library/HTMLPurifier/ConfigDef/Directive.php
Normal file
55
library/HTMLPurifier/ConfigDef/Directive.php
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structure object containing definition of a directive.
|
||||||
|
* @note This structure does not contain default values
|
||||||
|
*/
|
||||||
|
class HTMLPurifier_ConfigDef_Directive extends HTMLPurifier_ConfigDef
|
||||||
|
{
|
||||||
|
|
||||||
|
public $class = 'directive';
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
$type = null,
|
||||||
|
$allow_null = null,
|
||||||
|
$allowed = null,
|
||||||
|
$aliases = null
|
||||||
|
) {
|
||||||
|
if ( $type !== null) $this->type = $type;
|
||||||
|
if ( $allow_null !== null) $this->allow_null = $allow_null;
|
||||||
|
if ( $allowed !== null) $this->allowed = $allowed;
|
||||||
|
if ( $aliases !== null) $this->aliases = $aliases;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allowed type of the directive. Values are:
|
||||||
|
* - string
|
||||||
|
* - istring (case insensitive string)
|
||||||
|
* - int
|
||||||
|
* - float
|
||||||
|
* - bool
|
||||||
|
* - lookup (array of value => true)
|
||||||
|
* - list (regular numbered index array)
|
||||||
|
* - hash (array of key => value)
|
||||||
|
* - mixed (anything goes)
|
||||||
|
*/
|
||||||
|
public $type = 'mixed';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is null allowed? Has no effect for mixed type.
|
||||||
|
* @bool
|
||||||
|
*/
|
||||||
|
public $allow_null = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup table of allowed values of the element, bool true if all allowed.
|
||||||
|
*/
|
||||||
|
public $allowed = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hash of value aliases, i.e. values that are equivalent.
|
||||||
|
*/
|
||||||
|
public $aliases = array();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
24
library/HTMLPurifier/ConfigDef/DirectiveAlias.php
Normal file
24
library/HTMLPurifier/ConfigDef/DirectiveAlias.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structure object describing a directive alias
|
||||||
|
*/
|
||||||
|
class HTMLPurifier_ConfigDef_DirectiveAlias extends HTMLPurifier_ConfigDef
|
||||||
|
{
|
||||||
|
public $class = 'alias';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Namespace being aliased to
|
||||||
|
*/
|
||||||
|
public $namespace;
|
||||||
|
/**
|
||||||
|
* Directive being aliased to
|
||||||
|
*/
|
||||||
|
public $name;
|
||||||
|
|
||||||
|
public function __construct($namespace, $name) {
|
||||||
|
$this->namespace = $namespace;
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
10
library/HTMLPurifier/ConfigDef/Namespace.php
Normal file
10
library/HTMLPurifier/ConfigDef/Namespace.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structure object describing of a namespace
|
||||||
|
*/
|
||||||
|
class HTMLPurifier_ConfigDef_Namespace extends HTMLPurifier_ConfigDef
|
||||||
|
{
|
||||||
|
public $class = 'namespace';
|
||||||
|
}
|
||||||
|
|
@@ -12,33 +12,7 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
public $defaults = array();
|
public $defaults = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Definition of the directives. The structure of this is:
|
* Definition of the directives.
|
||||||
*
|
|
||||||
* array(
|
|
||||||
* 'Namespace' => array(
|
|
||||||
* 'Directive' => new stdclass(),
|
|
||||||
* )
|
|
||||||
* )
|
|
||||||
*
|
|
||||||
* The stdclass may have the following properties:
|
|
||||||
*
|
|
||||||
* - If isAlias isn't set:
|
|
||||||
* - type: Integer type of directive, see HTMLPurifier_VarParser for definitions
|
|
||||||
* - allow_null: If set, this directive allows null values
|
|
||||||
* - aliases: If set, an associative array of value aliases to real values
|
|
||||||
* - allowed: If set, a lookup array of allowed (string) values
|
|
||||||
* - If isAlias is set:
|
|
||||||
* - namespace: Namespace this directive aliases to
|
|
||||||
* - name: Directive name this directive aliases to
|
|
||||||
*
|
|
||||||
* In certain degenerate cases, stdclass will actually be an integer. In
|
|
||||||
* that case, the value is equivalent to an stdclass with the type
|
|
||||||
* property set to the integer. If the integer is negative, type is
|
|
||||||
* equal to the absolute value of integer, and allow_null is true.
|
|
||||||
*
|
|
||||||
* This class is friendly with HTMLPurifier_Config. If you need introspection
|
|
||||||
* about the schema, you're better of using the ConfigSchema_Interchange,
|
|
||||||
* which uses more memory but has much richer information.
|
|
||||||
*/
|
*/
|
||||||
public $info = array();
|
public $info = array();
|
||||||
|
|
||||||
@@ -47,6 +21,15 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
*/
|
*/
|
||||||
static protected $singleton;
|
static protected $singleton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Variable parser.
|
||||||
|
*/
|
||||||
|
protected $parser;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->parser = new HTMLPurifier_VarParser_Flexible();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unserializes the default ConfigSchema.
|
* Unserializes the default ConfigSchema.
|
||||||
*/
|
*/
|
||||||
@@ -79,11 +62,11 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
* @param $allow_null Whether or not to allow null values
|
* @param $allow_null Whether or not to allow null values
|
||||||
*/
|
*/
|
||||||
public function add($namespace, $name, $default, $type, $allow_null) {
|
public function add($namespace, $name, $default, $type, $allow_null) {
|
||||||
$obj = new stdclass();
|
$default = $this->parser->parse($default, $type, $allow_null);
|
||||||
$obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type];
|
$this->info[$namespace][$name] = new HTMLPurifier_ConfigDef_Directive();
|
||||||
if ($allow_null) $obj->allow_null = true;
|
$this->info[$namespace][$name]->type = $type;
|
||||||
$this->info[$namespace][$name] = $obj;
|
$this->info[$namespace][$name]->allow_null = $allow_null;
|
||||||
$this->defaults[$namespace][$name] = $default;
|
$this->defaults[$namespace][$name] = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,9 +90,6 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
* @param $aliases Hash of aliased values to the real alias
|
* @param $aliases Hash of aliased values to the real alias
|
||||||
*/
|
*/
|
||||||
public function addValueAliases($namespace, $name, $aliases) {
|
public function addValueAliases($namespace, $name, $aliases) {
|
||||||
if (!isset($this->info[$namespace][$name]->aliases)) {
|
|
||||||
$this->info[$namespace][$name]->aliases = array();
|
|
||||||
}
|
|
||||||
foreach ($aliases as $alias => $real) {
|
foreach ($aliases as $alias => $real) {
|
||||||
$this->info[$namespace][$name]->aliases[$alias] = $real;
|
$this->info[$namespace][$name]->aliases[$alias] = $real;
|
||||||
}
|
}
|
||||||
@@ -124,6 +104,7 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
* @param $allowed Lookup array of allowed values
|
* @param $allowed Lookup array of allowed values
|
||||||
*/
|
*/
|
||||||
public function addAllowedValues($namespace, $name, $allowed) {
|
public function addAllowedValues($namespace, $name, $allowed) {
|
||||||
|
$type = $this->info[$namespace][$name]->type;
|
||||||
$this->info[$namespace][$name]->allowed = $allowed;
|
$this->info[$namespace][$name]->allowed = $allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,26 +116,7 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
* @param $new_name Directive that the alias will be to
|
* @param $new_name Directive that the alias will be to
|
||||||
*/
|
*/
|
||||||
public function addAlias($namespace, $name, $new_namespace, $new_name) {
|
public function addAlias($namespace, $name, $new_namespace, $new_name) {
|
||||||
$obj = new stdclass;
|
$this->info[$namespace][$name] = new HTMLPurifier_ConfigDef_DirectiveAlias($new_namespace, $new_name);
|
||||||
$obj->namespace = $new_namespace;
|
|
||||||
$obj->name = $new_name;
|
|
||||||
$obj->isAlias = true;
|
|
||||||
$this->info[$namespace][$name] = $obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replaces any stdclass that only has the type property with type integer.
|
|
||||||
*/
|
|
||||||
public function postProcess() {
|
|
||||||
foreach ($this->info as $namespace => $info) {
|
|
||||||
foreach ($info as $directive => $v) {
|
|
||||||
if (count((array) $v) == 1) {
|
|
||||||
$this->info[$namespace][$directive] = $v->type;
|
|
||||||
} elseif (count((array) $v) == 2 && isset($v->allow_null)) {
|
|
||||||
$this->info[$namespace][$directive] = -$v->type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED METHODS
|
// DEPRECATED METHODS
|
||||||
@@ -162,6 +124,7 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
/** @see HTMLPurifier_ConfigSchema->set() */
|
/** @see HTMLPurifier_ConfigSchema->set() */
|
||||||
public static function define($namespace, $name, $default, $type, $description) {
|
public static function define($namespace, $name, $default, $type, $description) {
|
||||||
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
|
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
|
||||||
|
// process modifiers (OPTIMIZE!)
|
||||||
$type_values = explode('/', $type, 2);
|
$type_values = explode('/', $type, 2);
|
||||||
$type = $type_values[0];
|
$type = $type_values[0];
|
||||||
$modifier = isset($type_values[1]) ? $type_values[1] : false;
|
$modifier = isset($type_values[1]) ? $type_values[1] : false;
|
||||||
@@ -205,8 +168,7 @@ class HTMLPurifier_ConfigSchema {
|
|||||||
/** @deprecated, use HTMLPurifier_VarParser->parse() */
|
/** @deprecated, use HTMLPurifier_VarParser->parse() */
|
||||||
public function validate($a, $b, $c = false) {
|
public function validate($a, $b, $c = false) {
|
||||||
trigger_error("HTMLPurifier_ConfigSchema->validate deprecated, use HTMLPurifier_VarParser->parse instead", E_USER_NOTICE);
|
trigger_error("HTMLPurifier_ConfigSchema->validate deprecated, use HTMLPurifier_VarParser->parse instead", E_USER_NOTICE);
|
||||||
$parser = new HTMLPurifier_VarParser();
|
return $this->parser->parse($a, $b, $c);
|
||||||
return $parser->parse($a, $b, $c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,7 +43,6 @@ class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$schema->postProcess();
|
|
||||||
return $schema;
|
return $schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -111,8 +111,7 @@ class HTMLPurifier_ConfigSchema_Validator
|
|||||||
if (!is_null($d->allowed) || !empty($d->valueAliases)) {
|
if (!is_null($d->allowed) || !empty($d->valueAliases)) {
|
||||||
// allowed and valueAliases require that we be dealing with
|
// allowed and valueAliases require that we be dealing with
|
||||||
// strings, so check for that early.
|
// strings, so check for that early.
|
||||||
$d_int = HTMLPurifier_VarParser::$types[$d->type];
|
if (!isset(HTMLPurifier_VarParser::$stringTypes[$d->type])) {
|
||||||
if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) {
|
|
||||||
$this->error('type', 'must be a string type when used with allowed or value aliases');
|
$this->error('type', 'must be a string type when used with allowed or value aliases');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -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.)
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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'
|
||||||
|
@@ -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
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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!
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
Attr
|
Attr
|
||||||
DESCRIPTION: Features regarding attribute validation.
|
DESCRIPTION: Features regarding attribute validation.
|
||||||
|
@@ -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>
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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)
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
AutoFormatParam
|
AutoFormatParam
|
||||||
DESCRIPTION: Configuration for customizing auto-formatting functionality
|
DESCRIPTION: Configuration for customizing auto-formatting functionality
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
CSS.MaxImgLength
|
|
||||||
TYPE: string/null
|
|
||||||
DEFAULT: '1200px'
|
|
||||||
VERSION: 3.1.1
|
|
||||||
--DESCRIPTION--
|
|
||||||
<p>
|
|
||||||
This parameter sets the maximum allowed length on <code>img</code> tags,
|
|
||||||
effectively the <code>width</code> and <code>height</code> properties.
|
|
||||||
Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is
|
|
||||||
in place to prevent imagecrash attacks, disable with null at your own risk.
|
|
||||||
This directive is similar to %HTML.MaxImgLength, and both should be
|
|
||||||
concurrently edited, although there are
|
|
||||||
subtle differences in the input format (the CSS max is a number with
|
|
||||||
a unit).
|
|
||||||
</p>
|
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
CSS
|
CSS
|
||||||
DESCRIPTION: Configuration regarding allowed CSS.
|
DESCRIPTION: Configuration regarding allowed CSS.
|
||||||
|
@@ -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
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
Cache
|
Cache
|
||||||
DESCRIPTION: Configuration for DefinitionCache and related subclasses.
|
DESCRIPTION: Configuration for DefinitionCache and related subclasses.
|
||||||
|
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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!
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
Core
|
Core
|
||||||
DESCRIPTION: Core features that are always available.
|
DESCRIPTION: Core features that are always available.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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 <, > and &
|
Whether or not to escape the dangerous characters <, > and &
|
||||||
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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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><blockquote>Foo</blockquote></code> would become
|
<code><blockquote>Foo</blockquote></code> would become
|
||||||
<code><blockquote><p>Foo</p></blockquote></code>.
|
<code><blockquote><p>Foo</p></blockquote></code>.
|
||||||
The <code><p></code> tags can be replaced with whatever you desire,
|
The <code><p></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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -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'
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
HTML.MaxImgLength
|
|
||||||
TYPE: int/null
|
|
||||||
DEFAULT: 1200
|
|
||||||
VERSION: 3.1.1
|
|
||||||
--DESCRIPTION--
|
|
||||||
<p>
|
|
||||||
This directive controls the maximum number of pixels in the width and
|
|
||||||
height attributes in <code>img</code> tags. This is
|
|
||||||
in place to prevent imagecrash attacks, disable with null at your own risk.
|
|
||||||
This directive is similar to %CSS.MaxImgLength, and both should be
|
|
||||||
concurrently edited, although there are
|
|
||||||
subtle differences in the input format (the HTML max is an integer).
|
|
||||||
</p>
|
|
@@ -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>
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
HTML.SafeEmbed
|
|
||||||
TYPE: bool
|
|
||||||
VERSION: 3.1.1
|
|
||||||
DEFAULT: false
|
|
||||||
--DESCRIPTION--
|
|
||||||
<p>
|
|
||||||
Whether or not to permit embed tags in documents, with a number of extra
|
|
||||||
security features added to prevent script execution. This is similar to
|
|
||||||
what websites like MySpace do to embed tags. Embed is a proprietary
|
|
||||||
element and will cause your website to stop validating. You probably want
|
|
||||||
to enable this with %HTML.SafeObject.
|
|
||||||
<strong>Highly experimental.</strong>
|
|
||||||
</p>
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user