From 63e6a809768a261c1c1294979767b7ce76a47952 Mon Sep 17 00:00:00 2001
From: skodak to
foreach ($definition->info[$token->name]->attr_transform_pre as $transform) {
@@ -63,19 +63,19 @@ class HTMLPurifier_AttrValidator
if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr);
}
}
-
+
// create alias to this element's attribute definition array, see
// also $d_defs (global attribute definition array)
// DEFINITION CALL
$defs = $definition->info[$token->name]->attr;
-
+
$attr_key = false;
$context->register('CurrentAttr', $attr_key);
-
+
// iterate through all the attribute keypairs
// Watch out for name collisions: $key has previously been used
foreach ($attr as $attr_key => $value) {
-
+
// call the definition
if ( isset($defs[$attr_key]) ) {
// there is a local definition defined
@@ -102,37 +102,37 @@ class HTMLPurifier_AttrValidator
// system never heard of the attribute? DELETE!
$result = false;
}
-
+
// put the results into effect
if ($result === false || $result === null) {
// this is a generic error message that should replaced
// with more specific ones when possible
if ($e) $e->send(E_ERROR, 'AttrValidator: Attribute removed');
-
+
// remove the attribute
unset($attr[$attr_key]);
} elseif (is_string($result)) {
// generally, if a substitution is happening, there
// was some sort of implicit correction going on. We'll
// delegate it to the attribute classes to say exactly what.
-
+
// simple substitution
$attr[$attr_key] = $result;
} else {
// nothing happens
}
-
+
// we'd also want slightly more complicated substitution
// involving an array as the return value,
// although we're not sure how colliding attributes would
// resolve (certain ones would be completely overriden,
// others would prepend themselves).
}
-
+
$context->destroy('CurrentAttr');
-
+
// post transforms
-
+
// global (error reporting untested)
foreach ($definition->info_attr_transform_post as $transform) {
$attr = $transform->transform($o = $attr, $config, $context);
@@ -140,7 +140,7 @@ class HTMLPurifier_AttrValidator
if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr);
}
}
-
+
// local (error reporting untested)
foreach ($definition->info[$token->name]->attr_transform_post as $transform) {
$attr = $transform->transform($o = $attr, $config, $context);
@@ -148,14 +148,15 @@ class HTMLPurifier_AttrValidator
if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr);
}
}
-
+
$token->attr = $attr;
-
+
// destroy CurrentToken if we made it ourselves
if (!$current_token) $context->destroy('CurrentToken');
-
+
}
-
-
+
+
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/Bootstrap.php b/lib/htmlpurifier/HTMLPurifier/Bootstrap.php
index 09dcb5019d..559f61a232 100644
--- a/lib/htmlpurifier/HTMLPurifier/Bootstrap.php
+++ b/lib/htmlpurifier/HTMLPurifier/Bootstrap.php
@@ -29,7 +29,7 @@ if (!defined('PHP_EOL')) {
*/
class HTMLPurifier_Bootstrap
{
-
+
/**
* Autoload function for HTML Purifier
* @param $class Class to load
@@ -40,7 +40,7 @@ class HTMLPurifier_Bootstrap
require HTMLPURIFIER_PREFIX . '/' . $file;
return true;
}
-
+
/**
* Returns the path for a specific class.
*/
@@ -56,7 +56,7 @@ class HTMLPurifier_Bootstrap
if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) return false;
return $file;
}
-
+
/**
* "Pre-registers" our autoloader on the SPL stack.
*/
@@ -92,5 +92,7 @@ class HTMLPurifier_Bootstrap
foreach ($funcs as $func) spl_autoload_register($func);
}
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/CSSDefinition.php b/lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
index 36dfa618b7..1a18057338 100644
--- a/lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
+++ b/lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
@@ -6,32 +6,32 @@
*/
class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
{
-
+
public $type = 'CSS';
-
+
/**
* Assoc array of attribute name to definition object.
*/
public $info = array();
-
+
/**
* Constructs the info array. The meat of this class.
*/
protected function doSetup($config) {
-
+
$this->info['text-align'] = new HTMLPurifier_AttrDef_Enum(
array('left', 'right', 'center', 'justify'), false);
-
+
$border_style =
- $this->info['border-bottom-style'] =
- $this->info['border-right-style'] =
- $this->info['border-left-style'] =
+ $this->info['border-bottom-style'] =
+ $this->info['border-right-style'] =
+ $this->info['border-left-style'] =
$this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum(
array('none', 'hidden', 'dotted', 'dashed', 'solid', 'double',
'groove', 'ridge', 'inset', 'outset'), false);
-
+
$this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style);
-
+
$this->info['clear'] = new HTMLPurifier_AttrDef_Enum(
array('none', 'left', 'right', 'both'), false);
$this->info['float'] = new HTMLPurifier_AttrDef_Enum(
@@ -40,27 +40,27 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
array('normal', 'italic', 'oblique'), false);
$this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum(
array('normal', 'small-caps'), false);
-
+
$uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite(
array(
new HTMLPurifier_AttrDef_Enum(array('none')),
new HTMLPurifier_AttrDef_CSS_URI()
)
);
-
+
$this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum(
array('inside', 'outside'), false);
$this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum(
array('disc', 'circle', 'square', 'decimal', 'lower-roman',
'upper-roman', 'lower-alpha', 'upper-alpha', 'none'), false);
$this->info['list-style-image'] = $uri_or_none;
-
+
$this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config);
-
+
$this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum(
array('capitalize', 'uppercase', 'lowercase', 'none'), false);
$this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color();
-
+
$this->info['background-image'] = $uri_or_none;
$this->info['background-repeat'] = new HTMLPurifier_AttrDef_Enum(
array('repeat', 'repeat-x', 'repeat-y', 'no-repeat')
@@ -69,42 +69,42 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
array('scroll', 'fixed')
);
$this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
-
- $border_color =
- $this->info['border-top-color'] =
- $this->info['border-bottom-color'] =
- $this->info['border-left-color'] =
- $this->info['border-right-color'] =
+
+ $border_color =
+ $this->info['border-top-color'] =
+ $this->info['border-bottom-color'] =
+ $this->info['border-left-color'] =
+ $this->info['border-right-color'] =
$this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('transparent')),
new HTMLPurifier_AttrDef_CSS_Color()
));
-
+
$this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config);
-
+
$this->info['border-color'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_color);
-
- $border_width =
- $this->info['border-top-width'] =
- $this->info['border-bottom-width'] =
- $this->info['border-left-width'] =
+
+ $border_width =
+ $this->info['border-top-width'] =
+ $this->info['border-bottom-width'] =
+ $this->info['border-left-width'] =
$this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')),
new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative
));
-
+
$this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width);
-
+
$this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Length()
));
-
+
$this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Length()
));
-
+
$this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('xx-small', 'x-small',
'small', 'medium', 'large', 'x-large', 'xx-large',
@@ -112,54 +112,54 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
new HTMLPurifier_AttrDef_CSS_Percentage(),
new HTMLPurifier_AttrDef_CSS_Length()
));
-
+
$this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true)
));
-
+
$margin =
- $this->info['margin-top'] =
- $this->info['margin-bottom'] =
- $this->info['margin-left'] =
+ $this->info['margin-top'] =
+ $this->info['margin-bottom'] =
+ $this->info['margin-left'] =
$this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage(),
new HTMLPurifier_AttrDef_Enum(array('auto'))
));
-
+
$this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin);
-
+
// non-negative
$padding =
- $this->info['padding-top'] =
- $this->info['padding-bottom'] =
- $this->info['padding-left'] =
+ $this->info['padding-top'] =
+ $this->info['padding-bottom'] =
+ $this->info['padding-left'] =
$this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true)
));
-
+
$this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding);
-
+
$this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_CSS_Length(),
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['height'] =
$max === null ?
- $trusted_wh :
+ $trusted_wh :
new HTMLPurifier_AttrDef_Switch('img',
// For img tags:
new HTMLPurifier_AttrDef_CSS_Composite(array(
@@ -169,65 +169,65 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
// For everyone else:
$trusted_wh
);
-
+
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
-
+
$this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily();
-
+
// this could use specialized code
$this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum(
array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300',
'400', '500', '600', '700', '800', '900'), false);
-
+
// MUST be called after other font properties, as it references
// a CSSDefinition object
$this->info['font'] = new HTMLPurifier_AttrDef_CSS_Font($config);
-
+
// same here
$this->info['border'] =
- $this->info['border-bottom'] =
- $this->info['border-top'] =
- $this->info['border-left'] =
+ $this->info['border-bottom'] =
+ $this->info['border-top'] =
+ $this->info['border-left'] =
$this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config);
-
+
$this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(array(
'collapse', 'separate'));
-
+
$this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(array(
'top', 'bottom'));
-
+
$this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(array(
'auto', 'fixed'));
-
+
$this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('baseline', 'sub', 'super',
'top', 'text-top', 'middle', 'bottom', 'text-bottom')),
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage()
));
-
+
$this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2);
-
+
// partial support
$this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(array('nowrap'));
-
+
if ($config->get('CSS', 'Proprietary')) {
$this->doSetupProprietary($config);
}
-
+
if ($config->get('CSS', 'AllowTricky')) {
$this->doSetupTricky($config);
}
-
+
$allow_important = $config->get('CSS', 'AllowImportant');
// wrap all attr-defs with decorator that handles !important
foreach ($this->info as $k => $v) {
$this->info[$k] = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($v, $allow_important);
}
-
+
$this->setupConfigStuff($config);
}
-
+
protected function doSetupProprietary($config) {
// Internet Explorer only scrollbar colors
$this->info['scrollbar-arrow-color'] = new HTMLPurifier_AttrDef_CSS_Color();
@@ -236,17 +236,17 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['scrollbar-face-color'] = new HTMLPurifier_AttrDef_CSS_Color();
$this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color();
$this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color();
-
+
// technically not proprietary, but CSS3, and no one supports it
$this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
$this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
$this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
-
+
// only opacity, for now
$this->info['filter'] = new HTMLPurifier_AttrDef_CSS_Filter();
-
+
}
-
+
protected function doSetupTricky($config) {
$this->info['display'] = new HTMLPurifier_AttrDef_Enum(array(
'inline', 'block', 'list-item', 'run-in', 'compact',
@@ -257,9 +257,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(array(
'visible', 'hidden', 'collapse'
));
+ $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll'));
}
-
-
+
+
/**
* Performs extra config-based processing. Based off of
* HTMLPurifier_HTMLDefinition.
@@ -267,7 +268,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
* composition, not inheritance).
*/
protected function setupConfigStuff($config) {
-
+
// setup allowed elements
$support = "(for information on implementing this, see the ".
"support forums) ";
@@ -284,7 +285,8 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
trigger_error("Style attribute '$name' is not supported $support", E_USER_WARNING);
}
}
-
+
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef.php b/lib/htmlpurifier/HTMLPurifier/ChildDef.php
index 38f3692f51..c5d5216dab 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef.php
@@ -10,31 +10,31 @@ abstract class HTMLPurifier_ChildDef
* Used occasionally in terms of context.
*/
public $type;
-
+
/**
* Bool that indicates whether or not an empty array of children is okay
- *
+ *
* This is necessary for redundant checking when changes affecting
* a child node may cause a parent node to now be disallowed.
*/
public $allow_empty;
-
+
/**
* Lookup array of all elements that this definition could possibly allow
*/
public $elements = array();
-
+
/**
* Get lookup of tag names that should not close this element automatically.
* All other elements will do so.
*/
- public function getNonAutoCloseElements($config) {
+ public function getAllowedElements($config) {
return $this->elements;
}
-
+
/**
* Validates nodes according to definition and returns modification.
- *
+ *
* @param $tokens_of_children Array of HTMLPurifier_Token
* @param $config HTMLPurifier_Config object
* @param $context HTMLPurifier_Context object
@@ -45,4 +45,4 @@ abstract class HTMLPurifier_ChildDef
abstract public function validateChildren($tokens_of_children, $config, $context);
}
-
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Chameleon.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Chameleon.php
index d918080a19..15c364ee33 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Chameleon.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Chameleon.php
@@ -2,7 +2,7 @@
/**
* Definition that uses different definitions depending on context.
- *
+ *
* The del and ins tags are notable because they allow different types of
* elements depending on whether or not they're in a block or inline context.
* Chameleon allows this behavior to happen by using two different
@@ -11,19 +11,19 @@
*/
class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef
{
-
+
/**
* Instance of the definition object to use when inline. Usually stricter.
*/
public $inline;
-
+
/**
* Instance of the definition object to use when block.
*/
public $block;
-
+
public $type = 'chameleon';
-
+
/**
* @param $inline List of elements to allow when inline.
* @param $block List of elements to allow when block.
@@ -33,7 +33,7 @@ class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef
$this->block = new HTMLPurifier_ChildDef_Optional($block);
$this->elements = $this->block->elements;
}
-
+
public function validateChildren($tokens_of_children, $config, $context) {
if ($context->get('IsInline') === false) {
return $this->block->validateChildren(
@@ -45,3 +45,4 @@ class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Custom.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Custom.php
index f79bfcae60..b68047b4b5 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Custom.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Custom.php
@@ -2,7 +2,7 @@
/**
* Custom validation class, accepts DTD child definitions
- *
+ *
* @warning Currently this class is an all or nothing proposition, that is,
* it will only give a bool return value.
*/
@@ -36,25 +36,25 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
}
$el = '[#a-zA-Z0-9_.-]+';
$reg = $raw;
-
+
// COMPLICATED! AND MIGHT BE BUGGY! I HAVE NO CLUE WHAT I'M
// DOING! Seriously: if there's problems, please report them.
-
+
// collect all elements into the $elements array
preg_match_all("/$el/", $reg, $matches);
foreach ($matches[0] as $match) {
$this->elements[$match] = true;
}
-
+
// setup all elements as parentheticals with leading commas
$reg = preg_replace("/$el/", '(,\\0)', $reg);
-
+
// remove commas when they were not solicited
$reg = preg_replace("/([^,(|]\(+),/", '\\1', $reg);
-
+
// remove all non-paranthetical commas: they are handled by first regex
$reg = preg_replace("/,\(/", '(', $reg);
-
+
$this->_pcre_regex = $reg;
}
public function validateChildren($tokens_of_children, $config, $context) {
@@ -62,15 +62,15 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
$nesting = 0; // depth into the nest
foreach ($tokens_of_children as $token) {
if (!empty($token->is_whitespace)) continue;
-
+
$is_child = ($nesting == 0); // direct
-
+
if ($token instanceof HTMLPurifier_Token_Start) {
$nesting++;
} elseif ($token instanceof HTMLPurifier_Token_End) {
$nesting--;
}
-
+
if ($is_child) {
$list_of_children .= $token->name . ',';
}
@@ -82,8 +82,9 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
'/^,?'.$this->_pcre_regex.'$/',
$list_of_children
);
-
+
return (bool) $okay;
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Empty.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Empty.php
index ad4dc0b7cd..13171f6651 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Empty.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Empty.php
@@ -17,3 +17,4 @@ class HTMLPurifier_ChildDef_Empty extends HTMLPurifier_ChildDef
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Optional.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Optional.php
index dcf39cdc86..32bcb9898e 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Optional.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Optional.php
@@ -13,11 +13,14 @@ class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
public $type = 'optional';
public function validateChildren($tokens_of_children, $config, $context) {
$result = parent::validateChildren($tokens_of_children, $config, $context);
+ // we assume that $tokens_of_children is not modified
if ($result === false) {
if (empty($tokens_of_children)) return true;
+ elseif ($this->whitespace) return $tokens_of_children;
else return array();
}
return $result;
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Required.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Required.php
index 2009fc8835..c3e748b260 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Required.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Required.php
@@ -10,6 +10,10 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
* @public
*/
public $elements = array();
+ /**
+ * Whether or not the last passed node was all whitespace.
+ */
+ protected $whitespace = false;
/**
* @param $elements List of allowed element names (lowercase).
*/
@@ -31,47 +35,50 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
public $allow_empty = false;
public $type = 'required';
public function validateChildren($tokens_of_children, $config, $context) {
+ // Flag for subclasses
+ $this->whitespace = false;
+
// if there are no tokens, delete parent node
if (empty($tokens_of_children)) return false;
-
+
// the new set of children
$result = array();
-
+
// current depth into the nest
$nesting = 0;
-
+
// whether or not we're deleting a node
$is_deleting = false;
-
+
// whether or not parsed character data is allowed
// this controls whether or not we silently drop a tag
// or generate escaped HTML from it
$pcdata_allowed = isset($this->elements['#PCDATA']);
-
+
// a little sanity check to make sure it's not ALL whitespace
$all_whitespace = true;
-
+
// some configuration
$escape_invalid_children = $config->get('Core', 'EscapeInvalidChildren');
-
+
// generator
$gen = new HTMLPurifier_Generator($config, $context);
-
+
foreach ($tokens_of_children as $token) {
if (!empty($token->is_whitespace)) {
$result[] = $token;
continue;
}
$all_whitespace = false; // phew, we're not talking about whitespace
-
+
$is_child = ($nesting == 0);
-
+
if ($token instanceof HTMLPurifier_Token_Start) {
$nesting++;
} elseif ($token instanceof HTMLPurifier_Token_End) {
$nesting--;
}
-
+
if ($is_child) {
$is_deleting = false;
if (!isset($this->elements[$token->name])) {
@@ -98,9 +105,13 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
}
}
if (empty($result)) return false;
- if ($all_whitespace) return false;
+ if ($all_whitespace) {
+ $this->whitespace = true;
+ return false;
+ }
if ($tokens_of_children == $result) return true;
return $result;
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/StrictBlockquote.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/StrictBlockquote.php
index ec0890d917..dfae8a6e5e 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/StrictBlockquote.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/StrictBlockquote.php
@@ -10,35 +10,35 @@ class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildDef_Requi
public $allow_empty = true;
public $type = 'strictblockquote';
protected $init = false;
-
+
/**
* @note We don't want MakeWellFormed to auto-close inline elements since
* they might be allowed.
*/
- public function getNonAutoCloseElements($config) {
+ public function getAllowedElements($config) {
$this->init($config);
return $this->fake_elements;
}
-
+
public function validateChildren($tokens_of_children, $config, $context) {
-
+
$this->init($config);
-
+
// trick the parent class into thinking it allows more
$this->elements = $this->fake_elements;
$result = parent::validateChildren($tokens_of_children, $config, $context);
$this->elements = $this->real_elements;
-
+
if ($result === false) return array();
if ($result === true) $result = $tokens_of_children;
-
+
$def = $config->getHTMLDefinition();
$block_wrap_start = new HTMLPurifier_Token_Start($def->info_block_wrapper);
$block_wrap_end = new HTMLPurifier_Token_End( $def->info_block_wrapper);
$is_inline = false;
$depth = 0;
$ret = array();
-
+
// assuming that there are no comment tokens
foreach ($result as $i => $token) {
$token = $result[$i];
@@ -72,7 +72,7 @@ class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildDef_Requi
if ($is_inline) $ret[] = $block_wrap_end;
return $ret;
}
-
+
private function init($config) {
if (!$this->init) {
$def = $config->getHTMLDefinition();
@@ -85,3 +85,4 @@ class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildDef_Requi
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ChildDef/Table.php b/lib/htmlpurifier/HTMLPurifier/ChildDef/Table.php
index d9d45bad95..34f0227dd2 100644
--- a/lib/htmlpurifier/HTMLPurifier/ChildDef/Table.php
+++ b/lib/htmlpurifier/HTMLPurifier/ChildDef/Table.php
@@ -12,31 +12,31 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
public function __construct() {}
public function validateChildren($tokens_of_children, $config, $context) {
if (empty($tokens_of_children)) return false;
-
+
// this ensures that the loop gets run one last time before closing
// up. It's a little bit of a hack, but it works! Just make sure you
// get rid of the token later.
$tokens_of_children[] = false;
-
+
// only one of these elements is allowed in a table
$caption = false;
$thead = false;
$tfoot = false;
-
+
// as many of these as you want
$cols = array();
$content = array();
-
+
$nesting = 0; // current depth so we can determine nodes
$is_collecting = false; // are we globbing together tokens to package
// into one of the collectors?
$collection = array(); // collected nodes
$tag_index = 0; // the first node might be whitespace,
// so this tells us where the start tag is
-
+
foreach ($tokens_of_children as $token) {
$is_child = ($nesting == 0);
-
+
if ($token === false) {
// terminating sequence started
} elseif ($token instanceof HTMLPurifier_Token_Start) {
@@ -44,7 +44,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
} elseif ($token instanceof HTMLPurifier_Token_End) {
$nesting--;
}
-
+
// handle node collection
if ($is_collecting) {
if ($is_child) {
@@ -85,10 +85,10 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
$collection[] = $token;
}
}
-
+
// terminate
if ($token === false) break;
-
+
if ($is_child) {
// determine what we're dealing with
if ($token->name == 'col') {
@@ -110,7 +110,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
$collection[] = $token;
continue;
default:
- if ($token instanceof HTMLPurifier_Token_Text && $token->is_whitespace) {
+ if (!empty($token->is_whitespace)) {
$collection[] = $token;
$tag_index++;
}
@@ -118,9 +118,9 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
}
}
}
-
+
if (empty($content)) return false;
-
+
$ret = array();
if ($caption !== false) $ret = array_merge($ret, $caption);
if ($cols !== false) foreach ($cols as $token_array) $ret = array_merge($ret, $token_array);
@@ -131,11 +131,12 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
// grab the trailing space
$ret = array_merge($ret, $collection);
}
-
+
array_pop($tokens_of_children); // remove phantom token
-
+
return ($ret === $tokens_of_children) ? true : $ret;
-
+
}
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/Config.php b/lib/htmlpurifier/HTMLPurifier/Config.php
index aca8498285..f8e1f7804e 100644
--- a/lib/htmlpurifier/HTMLPurifier/Config.php
+++ b/lib/htmlpurifier/HTMLPurifier/Config.php
@@ -5,79 +5,79 @@
*
* @warning This class is strongly defined: that means that the class
* will fail if an undefined directive is retrieved or set.
- *
+ *
* @note Many classes that could (although many times don't) use the
* configuration object make it a mandatory parameter. This is
* because a configuration object should always be forwarded,
* otherwise, you run the risk of missing a parameter and then
* being stumped when a configuration directive doesn't work.
- *
+ *
* @todo Reconsider some of the public member variables
*/
class HTMLPurifier_Config
{
-
+
/**
* HTML Purifier's version
*/
- public $version = '3.2.0';
-
+ public $version = '3.3.0';
+
/**
- * Bool indicator whether or not to automatically finalize
+ * Bool indicator whether or not to automatically finalize
* the object if a read operation is done
*/
public $autoFinalize = true;
-
+
// protected member variables
-
+
/**
* Namespace indexed array of serials for specific namespaces (see
* getSerial() for more info).
*/
protected $serials = array();
-
+
/**
* Serial for entire configuration object
*/
protected $serial;
-
- /**
- * Two-level associative array of configuration directives
- */
- protected $conf;
-
+
/**
* Parser for variables
*/
protected $parser;
-
+
/**
* Reference HTMLPurifier_ConfigSchema for value checking
* @note This is public for introspective purposes. Please don't
* abuse!
*/
public $def;
-
+
/**
* Indexed array of definitions
*/
protected $definitions;
-
+
/**
* Bool indicator whether or not config is finalized
*/
protected $finalized = false;
-
+
+ /**
+ * Property list containing configuration directives.
+ */
+ protected $plist;
+
/**
* @param $definition HTMLPurifier_ConfigSchema that defines what directives
* are allowed.
*/
public function __construct($definition) {
- $this->conf = $definition->defaults; // set up, copy in defaults
- $this->def = $definition; // keep a copy around for checking
+ $this->plist = new HTMLPurifier_PropertyList($definition->defaultPlist);
+ $this->def = $definition; // keep a copy around for checking
$this->parser = new HTMLPurifier_VarParser_Flexible();
}
-
+
/**
* Convenience constructor that creates a config object based on a mixed var
* @param mixed $config Variable that defines the state of the config
@@ -101,7 +101,7 @@ class HTMLPurifier_Config
elseif (is_array($config)) $ret->loadArray($config);
return $ret;
}
-
+
/**
* Convenience constructor that creates a default configuration object.
* @return Default HTMLPurifier_Config object.
@@ -111,14 +111,14 @@ class HTMLPurifier_Config
$config = new HTMLPurifier_Config($definition);
return $config;
}
-
+
/**
* Retreives a value from the configuration.
* @param $namespace String namespace
* @param $key String key
*/
public function get($namespace, $key) {
- if (!$this->finalized && $this->autoFinalize) $this->finalize();
+ if (!$this->finalized) $this->autoFinalize ? $this->finalize() : $this->plist->squash(true);
if (!isset($this->def->info[$namespace][$key])) {
// can't add % due to SimpleTest bug
trigger_error('Cannot retrieve value of undefined directive ' . htmlspecialchars("$namespace.$key"),
@@ -131,23 +131,24 @@ class HTMLPurifier_Config
E_USER_ERROR);
return;
}
- return $this->conf[$namespace][$key];
+ return $this->plist->get("$namespace.$key");
}
-
+
/**
* Retreives an array of directives to values from a given namespace
* @param $namespace String namespace
*/
public function getBatch($namespace) {
- if (!$this->finalized && $this->autoFinalize) $this->finalize();
+ if (!$this->finalized) $this->autoFinalize ? $this->finalize() : $this->plist->squash(true);
if (!isset($this->def->info[$namespace])) {
trigger_error('Cannot retrieve undefined namespace ' . htmlspecialchars($namespace),
E_USER_WARNING);
return;
}
- return $this->conf[$namespace];
+ $full = $this->getAll();
+ return $full[$namespace];
}
-
+
/**
* Returns a md5 signature of a segment of the configuration object
* that uniquely identifies that particular configuration
@@ -163,7 +164,7 @@ class HTMLPurifier_Config
}
return $this->serials[$namespace];
}
-
+
/**
* Returns a md5 signature for the entire configuration object
* that uniquely identifies that particular configuration
@@ -174,15 +175,20 @@ class HTMLPurifier_Config
}
return $this->serial;
}
-
+
/**
* Retrieves all directives, organized by namespace
*/
public function getAll() {
- if (!$this->finalized && $this->autoFinalize) $this->finalize();
- return $this->conf;
+ if (!$this->finalized) $this->autoFinalize ? $this->finalize() : $this->plist->squash(true);
+ $ret = array();
+ foreach ($this->plist->squash() as $name => $value) {
+ list($ns, $key) = explode('.', $name, 2);
+ $ret[$ns][$key] = $value;
+ }
+ return $ret;
}
-
+
/**
* Sets a value to configuration.
* @param $namespace String namespace
@@ -197,7 +203,7 @@ class HTMLPurifier_Config
return;
}
$def = $this->def->info[$namespace][$key];
-
+
if (isset($def->isAlias)) {
if ($from_alias) {
trigger_error('Double-aliases not allowed, please fix '.
@@ -210,7 +216,7 @@ class HTMLPurifier_Config
trigger_error("$namespace.$key is an alias, preferred directive name is $new_ns.$new_dir", E_USER_NOTICE);
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;
@@ -221,7 +227,7 @@ class HTMLPurifier_Config
$type = $rtype;
$allow_null = isset($def->allow_null);
}
-
+
try {
$value = $this->parser->parse($value, $type, $allow_null);
} catch (HTMLPurifier_VarParserException $e) {
@@ -240,18 +246,18 @@ class HTMLPurifier_Config
return;
}
}
- $this->conf[$namespace][$key] = $value;
-
+ $this->plist->set("$namespace.$key", $value);
+
// reset definitions if the directives they depend on changed
- // this is a very costly process, so it's discouraged
+ // this is a very costly process, so it's discouraged
// with finalization
if ($namespace == 'HTML' || $namespace == 'CSS') {
$this->definitions[$namespace] = null;
}
-
+
$this->serials[$namespace] = false;
}
-
+
/**
* Convenience function for error reporting
*/
@@ -260,7 +266,7 @@ class HTMLPurifier_Config
foreach ($lookup as $name => $b) $list[] = $name;
return implode(', ', $list);
}
-
+
/**
* Retrieves object reference to the HTML definition.
* @param $raw Return a copy that has not been setup yet. Must be
@@ -269,7 +275,7 @@ class HTMLPurifier_Config
public function getHTMLDefinition($raw = false) {
return $this->getDefinition('HTML', $raw);
}
-
+
/**
* Retrieves object reference to the CSS definition
* @param $raw Return a copy that has not been setup yet. Must be
@@ -278,14 +284,14 @@ class HTMLPurifier_Config
public function getCSSDefinition($raw = false) {
return $this->getDefinition('CSS', $raw);
}
-
+
/**
* Retrieves a definition
* @param $type Type of definition: HTML, CSS, etc
* @param $raw Whether or not definition should be returned raw
*/
public function getDefinition($type, $raw = false) {
- if (!$this->finalized && $this->autoFinalize) $this->finalize();
+ if (!$this->finalized) $this->autoFinalize ? $this->finalize() : $this->plist->squash(true);
$factory = HTMLPurifier_DefinitionCacheFactory::instance();
$cache = $factory->create($type, $this);
if (!$raw) {
@@ -334,7 +340,7 @@ class HTMLPurifier_Config
$cache->set($this->definitions[$type], $this);
return $this->definitions[$type];
}
-
+
/**
* Loads configuration values from an array with the following structure:
* Namespace.Directive => Value
@@ -357,7 +363,7 @@ class HTMLPurifier_Config
}
}
}
-
+
/**
* Returns a list of array(namespace, directive) for all directives
* that are allowed in a web-form context as per an allowed
@@ -401,13 +407,13 @@ class HTMLPurifier_Config
}
return $ret;
}
-
+
/**
* Loads configuration values from $_GET/$_POST that were posted
* via ConfigForm
* @param $array $_GET or $_POST array to import
* @param $index Index/name that the config variables are in
- * @param $allowed List of allowed namespaces/directives
+ * @param $allowed List of allowed namespaces/directives
* @param $mq_fix Boolean whether or not to enable magic quotes fix
* @param $schema Instance of HTMLPurifier_ConfigSchema to use, if not global copy
*/
@@ -416,7 +422,7 @@ class HTMLPurifier_Config
$config = HTMLPurifier_Config::create($ret, $schema);
return $config;
}
-
+
/**
* Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
* @note Same parameters as loadArrayFromForm
@@ -425,7 +431,7 @@ class HTMLPurifier_Config
$ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def);
$this->loadArray($ret);
}
-
+
/**
* Prepares an array from a form into something usable for the more
* strict parts of HTMLPurifier_Config
@@ -433,7 +439,7 @@ class HTMLPurifier_Config
public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) {
if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array();
$mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc();
-
+
$allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema);
$ret = array();
foreach ($allowed as $key) {
@@ -449,7 +455,7 @@ class HTMLPurifier_Config
}
return $ret;
}
-
+
/**
* Loads configuration values from an ini file
* @param $filename Name of ini file
@@ -459,7 +465,7 @@ class HTMLPurifier_Config
$array = parse_ini_file($filename, true);
$this->loadArray($array);
}
-
+
/**
* Checks whether or not the configuration object is finalized.
* @param $error String error message, or false for no error
@@ -470,7 +476,7 @@ class HTMLPurifier_Config
}
return $this->finalized;
}
-
+
/**
* Finalizes configuration only if auto finalize is on and not
* already finalized
@@ -478,15 +484,14 @@ class HTMLPurifier_Config
public function autoFinalize() {
if (!$this->finalized && $this->autoFinalize) $this->finalize();
}
-
+
/**
* Finalizes a configuration object, prohibiting further change
*/
public function finalize() {
$this->finalized = true;
}
-
-}
-
+}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigDef.php b/lib/htmlpurifier/HTMLPurifier/ConfigDef.php
deleted file mode 100644
index fe35e7a6cf..0000000000
--- a/lib/htmlpurifier/HTMLPurifier/ConfigDef.php
+++ /dev/null
@@ -1,9 +0,0 @@
-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();
-
-}
-
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigDef/DirectiveAlias.php b/lib/htmlpurifier/HTMLPurifier/ConfigDef/DirectiveAlias.php
deleted file mode 100644
index 98b8edd1ce..0000000000
--- a/lib/htmlpurifier/HTMLPurifier/ConfigDef/DirectiveAlias.php
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace = $namespace;
- $this->name = $name;
- }
-}
-
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigDef/Namespace.php b/lib/htmlpurifier/HTMLPurifier/ConfigDef/Namespace.php
deleted file mode 100644
index f282065b0a..0000000000
--- a/lib/htmlpurifier/HTMLPurifier/ConfigDef/Namespace.php
+++ /dev/null
@@ -1,10 +0,0 @@
- 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
@@ -30,30 +35,34 @@ class HTMLPurifier_ConfigSchema {
* - 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();
-
+
/**
* Application-wide singleton
*/
static protected $singleton;
-
+
+ public function __construct() {
+ $this->defaultPlist = new HTMLPurifier_PropertyList();
+ }
+
/**
* Unserializes the default ConfigSchema.
*/
public static function makeFromSerial() {
return unserialize(file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'));
}
-
+
/**
* Retrieves an instance of the application-wide configuration definition.
*/
@@ -65,7 +74,7 @@ class HTMLPurifier_ConfigSchema {
}
return HTMLPurifier_ConfigSchema::$singleton;
}
-
+
/**
* Defines a directive for configuration
* @warning Will fail of directive's namespace is defined.
@@ -84,8 +93,9 @@ class HTMLPurifier_ConfigSchema {
if ($allow_null) $obj->allow_null = true;
$this->info[$namespace][$name] = $obj;
$this->defaults[$namespace][$name] = $default;
+ $this->defaultPlist->set("$namespace.$name", $default);
}
-
+
/**
* Defines a namespace for directives to be put into.
* @warning This is slightly different from the corresponding static
@@ -96,10 +106,10 @@ class HTMLPurifier_ConfigSchema {
$this->info[$namespace] = array();
$this->defaults[$namespace] = array();
}
-
+
/**
* Defines a directive value alias.
- *
+ *
* Directive value aliases are convenient for developers because it lets
* them set a directive to several values and get the same result.
* @param $namespace Directive's namespace
@@ -114,7 +124,7 @@ class HTMLPurifier_ConfigSchema {
$this->info[$namespace][$name]->aliases[$alias] = $real;
}
}
-
+
/**
* Defines a set of allowed values for a directive.
* @warning This is slightly different from the corresponding static
@@ -126,7 +136,7 @@ class HTMLPurifier_ConfigSchema {
public function addAllowedValues($namespace, $name, $allowed) {
$this->info[$namespace][$name]->allowed = $allowed;
}
-
+
/**
* Defines a directive alias for backwards compatibility
* @param $namespace
@@ -141,7 +151,7 @@ class HTMLPurifier_ConfigSchema {
$obj->isAlias = true;
$this->info[$namespace][$name] = $obj;
}
-
+
/**
* Replaces any stdclass that only has the type property with type integer.
*/
@@ -156,9 +166,9 @@ class HTMLPurifier_ConfigSchema {
}
}
}
-
+
// DEPRECATED METHODS
-
+
/** @see HTMLPurifier_ConfigSchema->set() */
public static function define($namespace, $name, $default, $type, $description) {
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
@@ -169,21 +179,21 @@ class HTMLPurifier_ConfigSchema {
$def = HTMLPurifier_ConfigSchema::instance();
$def->add($namespace, $name, $default, $type, $allow_null);
}
-
+
/** @see HTMLPurifier_ConfigSchema->addNamespace() */
public static function defineNamespace($namespace, $description) {
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
$def = HTMLPurifier_ConfigSchema::instance();
$def->addNamespace($namespace);
}
-
+
/** @see HTMLPurifier_ConfigSchema->addValueAliases() */
public static function defineValueAliases($namespace, $name, $aliases) {
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
$def = HTMLPurifier_ConfigSchema::instance();
$def->addValueAliases($namespace, $name, $aliases);
}
-
+
/** @see HTMLPurifier_ConfigSchema->addAllowedValues() */
public static function defineAllowedValues($namespace, $name, $allowed_values) {
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
@@ -194,28 +204,28 @@ class HTMLPurifier_ConfigSchema {
$def = HTMLPurifier_ConfigSchema::instance();
$def->addAllowedValues($namespace, $name, $allowed);
}
-
+
/** @see HTMLPurifier_ConfigSchema->addAlias() */
public static function defineAlias($namespace, $name, $new_namespace, $new_name) {
HTMLPurifier_ConfigSchema::deprecated(__METHOD__);
$def = HTMLPurifier_ConfigSchema::instance();
$def->addAlias($namespace, $name, $new_namespace, $new_name);
}
-
+
/** @deprecated, use HTMLPurifier_VarParser->parse() */
public function validate($a, $b, $c = false) {
trigger_error("HTMLPurifier_ConfigSchema->validate deprecated, use HTMLPurifier_VarParser->parse instead", E_USER_NOTICE);
$parser = new HTMLPurifier_VarParser();
return $parser->parse($a, $b, $c);
}
-
+
/**
* Throws an E_USER_NOTICE stating that a method is deprecated.
*/
private static function deprecated($method) {
trigger_error("Static HTMLPurifier_ConfigSchema::$method deprecated, use add*() method instead", E_USER_NOTICE);
}
-
-}
+}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
index 727f58eefa..987f547bca 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
@@ -6,7 +6,7 @@
*/
class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
{
-
+
public function build($interchange) {
$schema = new HTMLPurifier_ConfigSchema();
foreach ($interchange->namespaces as $n) {
@@ -46,5 +46,7 @@ class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
$schema->postProcess();
return $schema;
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php
index 3c398d667e..51bcab78cc 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php
@@ -6,69 +6,69 @@
*/
class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter
{
-
+
protected $interchange;
-
+
protected function writeHTMLDiv($html) {
$this->startElement('div');
-
+
$purifier = HTMLPurifier::getInstance();
$html = $purifier->purify($html);
$this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
$this->writeRaw($html);
-
+
$this->endElement(); // div
}
-
+
protected function export($var) {
if ($var === array()) return 'array()';
return var_export($var, true);
}
-
+
public function build($interchange) {
// global access, only use as last resort
$this->interchange = $interchange;
-
+
$this->setIndent(true);
$this->startDocument('1.0', 'UTF-8');
$this->startElement('configdoc');
$this->writeElement('title', $interchange->name);
-
+
foreach ($interchange->namespaces as $namespace) {
$this->buildNamespace($namespace);
}
-
+
$this->endElement(); // configdoc
$this->flush();
}
-
+
public function buildNamespace($namespace) {
$this->startElement('namespace');
$this->writeAttribute('id', $namespace->namespace);
-
+
$this->writeElement('name', $namespace->namespace);
$this->startElement('description');
$this->writeHTMLDiv($namespace->description);
$this->endElement(); // description
-
+
foreach ($this->interchange->directives as $directive) {
if ($directive->id->namespace !== $namespace->namespace) continue;
$this->buildDirective($directive);
}
-
+
$this->endElement(); // namespace
}
-
+
public function buildDirective($directive) {
$this->startElement('directive');
$this->writeAttribute('id', $directive->id->toString());
-
+
$this->writeElement('name', $directive->id->directive);
-
+
$this->startElement('aliases');
foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString());
$this->endElement(); // aliases
-
+
$this->startElement('constraints');
if ($directive->version) $this->writeElement('version', $directive->version);
$this->startElement('type');
@@ -88,19 +88,21 @@ class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter
$this->endElement();
}
$this->endElement(); // constraints
-
+
if ($directive->deprecatedVersion) {
$this->startElement('deprecated');
$this->writeElement('version', $directive->deprecatedVersion);
$this->writeElement('use', $directive->deprecatedUse->toString());
$this->endElement(); // deprecated
}
-
+
$this->startElement('description');
$this->writeHTMLDiv($directive->description);
$this->endElement(); // description
-
+
$this->endElement(); // directive
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Exception.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Exception.php
index 4c51d67013..2671516c58 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Exception.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Exception.php
@@ -5,5 +5,7 @@
*/
class HTMLPurifier_ConfigSchema_Exception extends HTMLPurifier_Exception
{
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange.php
index 37a374f0a1..365c66357f 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange.php
@@ -7,22 +7,22 @@
*/
class HTMLPurifier_ConfigSchema_Interchange
{
-
+
/**
* Name of the application this schema is describing.
*/
public $name;
-
+
/**
* Array of Namespace ID => array(namespace info)
*/
public $namespaces = array();
-
+
/**
* Array of Directive ID => array(directive info)
*/
public $directives = array();
-
+
/**
* Adds a namespace array to $namespaces
*/
@@ -32,7 +32,7 @@ class HTMLPurifier_ConfigSchema_Interchange
}
$this->namespaces[$i] = $namespace;
}
-
+
/**
* Adds a directive array to $directives
*/
@@ -42,7 +42,7 @@ class HTMLPurifier_ConfigSchema_Interchange
}
$this->directives[$i] = $directive;
}
-
+
/**
* Convenience function to perform standard validation. Throws exception
* on failed validation.
@@ -51,5 +51,7 @@ class HTMLPurifier_ConfigSchema_Interchange
$validator = new HTMLPurifier_ConfigSchema_Validator();
return $validator->validate($this);
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php
index 5c8c4797eb..ac8be0d970 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php
@@ -5,71 +5,73 @@
*/
class HTMLPurifier_ConfigSchema_Interchange_Directive
{
-
+
/**
* ID of directive, instance of HTMLPurifier_ConfigSchema_Interchange_Id.
*/
public $id;
-
+
/**
* String type, e.g. 'integer' or 'istring'.
*/
public $type;
-
+
/**
* Default value, e.g. 3 or 'DefaultVal'.
*/
public $default;
-
+
/**
* HTML description.
*/
public $description;
-
+
/**
* Boolean whether or not null is allowed as a value.
*/
public $typeAllowsNull = false;
-
+
/**
* Lookup table of allowed scalar values, e.g. array('allowed' => true).
* Null if all values are allowed.
*/
public $allowed;
-
+
/**
* List of aliases for the directive,
* e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))).
*/
public $aliases = array();
-
+
/**
* Hash of value aliases, e.g. array('alt' => 'real'). Null if value
* aliasing is disabled (necessary for non-scalar types).
*/
public $valueAliases;
-
+
/**
* Version of HTML Purifier the directive was introduced, e.g. '1.3.1'.
* Null if the directive has always existed.
*/
public $version;
-
+
/**
* ID of directive that supercedes this old directive, is an instance
* of HTMLPurifier_ConfigSchema_Interchange_Id. Null if not deprecated.
*/
public $deprecatedUse;
-
+
/**
* Version of HTML Purifier this directive was deprecated. Null if not
* deprecated.
*/
public $deprecatedVersion;
-
+
/**
* List of external projects this directive depends on, e.g. array('CSSTidy').
*/
public $external = array();
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
index 40a5fe3cc5..ec01589b62 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
@@ -5,14 +5,14 @@
*/
class HTMLPurifier_ConfigSchema_Interchange_Id
{
-
+
public $namespace, $directive;
-
+
public function __construct($namespace, $directive) {
$this->namespace = $namespace;
$this->directive = $directive;
}
-
+
/**
* @warning This is NOT magic, to ensure that people don't abuse SPL and
* cause problems for PHP 5.0 support.
@@ -20,10 +20,12 @@ class HTMLPurifier_ConfigSchema_Interchange_Id
public function toString() {
return $this->namespace . '.' . $this->directive;
}
-
+
public static function make($id) {
list($namespace, $directive) = explode('.', $id);
return new HTMLPurifier_ConfigSchema_Interchange_Id($namespace, $directive);
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Namespace.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Namespace.php
index 8fe8158191..3ffac0a0f4 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Namespace.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Namespace.php
@@ -5,15 +5,17 @@
*/
class HTMLPurifier_ConfigSchema_Interchange_Namespace
{
-
+
/**
* Name of namespace defined.
*/
public $namespace;
-
+
/**
* HTML description.
*/
public $description;
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
index 98a0c9d323..a1a24eacba 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
@@ -2,25 +2,25 @@
class HTMLPurifier_ConfigSchema_InterchangeBuilder
{
-
+
/**
* Used for processing DEFAULT, nothing else.
*/
protected $varParser;
-
+
public function __construct($varParser = null) {
$this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native();
}
-
+
public static function buildFromDirectory($dir = null) {
$parser = new HTMLPurifier_StringHashParser();
$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
$interchange = new HTMLPurifier_ConfigSchema_Interchange();
-
+
if (!$dir) $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema/';
$info = parse_ini_file($dir . 'info.ini');
$interchange->name = $info['name'];
-
+
$files = array();
$dh = opendir($dir);
while (false !== ($file = readdir($dh))) {
@@ -30,7 +30,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
$files[] = $file;
}
closedir($dh);
-
+
sort($files);
foreach ($files as $file) {
$builder->build(
@@ -38,10 +38,10 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
new HTMLPurifier_StringHash( $parser->parseFile($dir . $file) )
);
}
-
+
return $interchange;
}
-
+
/**
* Builds an interchange object based on a hash.
* @param $interchange HTMLPurifier_ConfigSchema_Interchange object to build
@@ -61,7 +61,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
}
$this->_findUnused($hash);
}
-
+
public function buildNamespace($interchange, $hash) {
$namespace = new HTMLPurifier_ConfigSchema_Interchange_Namespace();
$namespace->namespace = $hash->offsetGet('ID');
@@ -70,14 +70,14 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
}
$interchange->addNamespace($namespace);
}
-
+
public function buildDirective($interchange, $hash) {
$directive = new HTMLPurifier_ConfigSchema_Interchange_Directive();
-
+
// These are required elements:
$directive->id = $this->id($hash->offsetGet('ID'));
$id = $directive->id->toString(); // convenience
-
+
if (isset($hash['TYPE'])) {
$type = explode('/', $hash->offsetGet('TYPE'));
if (isset($type[1])) $directive->typeAllowsNull = true;
@@ -85,7 +85,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
} else {
throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined");
}
-
+
if (isset($hash['DEFAULT'])) {
try {
$directive->default = $this->varParser->parse($hash->offsetGet('DEFAULT'), $directive->type, $directive->typeAllowsNull);
@@ -93,19 +93,19 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'");
}
}
-
+
if (isset($hash['DESCRIPTION'])) {
$directive->description = $hash->offsetGet('DESCRIPTION');
}
-
+
if (isset($hash['ALLOWED'])) {
$directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED')));
}
-
+
if (isset($hash['VALUE-ALIASES'])) {
$directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES'));
}
-
+
if (isset($hash['ALIASES'])) {
$raw_aliases = trim($hash->offsetGet('ALIASES'));
$aliases = preg_split('/\s*,\s*/', $raw_aliases);
@@ -113,33 +113,33 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
$directive->aliases[] = $this->id($alias);
}
}
-
+
if (isset($hash['VERSION'])) {
$directive->version = $hash->offsetGet('VERSION');
}
-
+
if (isset($hash['DEPRECATED-USE'])) {
$directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE'));
}
-
+
if (isset($hash['DEPRECATED-VERSION'])) {
$directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION');
}
-
+
if (isset($hash['EXTERNAL'])) {
$directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));
}
-
+
$interchange->addDirective($directive);
}
-
+
/**
* Evaluates an array PHP code string without array() wrapper
*/
protected function evalArray($contents) {
return eval('return array('. $contents .');');
}
-
+
/**
* Converts an array list into a lookup array.
*/
@@ -148,7 +148,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
foreach ($array as $val) $ret[$val] = true;
return $ret;
}
-
+
/**
* Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id
* object based on a string Id.
@@ -156,7 +156,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
protected function id($id) {
return HTMLPurifier_ConfigSchema_Interchange_Id::make($id);
}
-
+
/**
* Triggers errors for any unused keys passed in the hash; such keys
* may indicate typos, missing values, etc.
@@ -170,6 +170,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder
}
}
}
-
+
}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
index 64a35430da..2dfd37baed 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
@@ -10,26 +10,26 @@
*/
class HTMLPurifier_ConfigSchema_Validator
{
-
+
/**
* Easy to access global objects.
*/
protected $interchange, $aliases;
-
+
/**
* Context-stack to provide easy to read error messages.
*/
protected $context = array();
-
+
/**
* HTMLPurifier_VarParser to test default's type.
*/
protected $parser;
-
+
public function __construct() {
$this->parser = new HTMLPurifier_VarParser();
}
-
+
/**
* Validates a fully-formed interchange object. Throws an
* HTMLPurifier_ConfigSchema_Exception if there's a problem.
@@ -50,7 +50,7 @@ class HTMLPurifier_ConfigSchema_Validator
}
return true;
}
-
+
/**
* Validates a HTMLPurifier_ConfigSchema_Interchange_Namespace object.
*/
@@ -64,7 +64,7 @@ class HTMLPurifier_ConfigSchema_Validator
->assertIsString(); // handled by InterchangeBuilder
array_pop($this->context);
}
-
+
/**
* Validates a HTMLPurifier_ConfigSchema_Interchange_Id object.
*/
@@ -83,7 +83,7 @@ class HTMLPurifier_ConfigSchema_Validator
->assertAlnum(); // implicit assertIsString handled by InterchangeBuilder
array_pop($this->context);
}
-
+
/**
* Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object.
*/
@@ -91,10 +91,10 @@ class HTMLPurifier_ConfigSchema_Validator
$id = $d->id->toString();
$this->context[] = "directive '$id'";
$this->validateId($d->id);
-
+
$this->with($d, 'description')
->assertNotEmpty();
-
+
// BEGIN - handled by InterchangeBuilder
$this->with($d, 'type')
->assertNotEmpty();
@@ -107,7 +107,7 @@ class HTMLPurifier_ConfigSchema_Validator
$this->error('default', 'had error: ' . $e->getMessage());
}
// END - handled by InterchangeBuilder
-
+
if (!is_null($d->allowed) || !empty($d->valueAliases)) {
// allowed and valueAliases require that we be dealing with
// strings, so check for that early.
@@ -116,14 +116,14 @@ class HTMLPurifier_ConfigSchema_Validator
$this->error('type', 'must be a string type when used with allowed or value aliases');
}
}
-
+
$this->validateDirectiveAllowed($d);
$this->validateDirectiveValueAliases($d);
$this->validateDirectiveAliases($d);
-
+
array_pop($this->context);
}
-
+
/**
* Extra validation if $allowed member variable of
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
@@ -142,7 +142,7 @@ class HTMLPurifier_ConfigSchema_Validator
}
array_pop($this->context);
}
-
+
/**
* Extra validation if $valueAliases member variable of
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
@@ -170,7 +170,7 @@ class HTMLPurifier_ConfigSchema_Validator
}
array_pop($this->context);
}
-
+
/**
* Extra validation if $aliases member variable of
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
@@ -193,9 +193,9 @@ class HTMLPurifier_ConfigSchema_Validator
}
array_pop($this->context);
}
-
+
// protected helper functions
-
+
/**
* Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom
* for validating simple member variables of objects.
@@ -203,7 +203,7 @@ class HTMLPurifier_ConfigSchema_Validator
protected function with($obj, $member) {
return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member);
}
-
+
/**
* Emits an error, providing helpful context.
*/
@@ -212,12 +212,14 @@ class HTMLPurifier_ConfigSchema_Validator
else $prefix = ucfirst($this->getFormattedContext());
throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg));
}
-
+
/**
* Returns a formatted context string.
*/
protected function getFormattedContext() {
return implode(' in ', array_reverse($this->context));
}
-
+
}
+
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php
index 2bb9967611..b95aea18cc 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php
@@ -8,47 +8,47 @@
*/
class HTMLPurifier_ConfigSchema_ValidatorAtom
{
-
+
protected $context, $obj, $member, $contents;
-
+
public function __construct($context, $obj, $member) {
$this->context = $context;
$this->obj = $obj;
$this->member = $member;
$this->contents =& $obj->$member;
}
-
+
public function assertIsString() {
if (!is_string($this->contents)) $this->error('must be a string');
return $this;
}
-
+
public function assertIsBool() {
if (!is_bool($this->contents)) $this->error('must be a boolean');
return $this;
}
-
+
public function assertIsArray() {
if (!is_array($this->contents)) $this->error('must be an array');
return $this;
}
-
+
public function assertNotNull() {
if ($this->contents === null) $this->error('must not be null');
return $this;
}
-
+
public function assertAlnum() {
$this->assertIsString();
if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric');
return $this;
}
-
+
public function assertNotEmpty() {
if (empty($this->contents)) $this->error('must not be empty');
return $this;
}
-
+
public function assertIsLookup() {
$this->assertIsArray();
foreach ($this->contents as $v) {
@@ -56,11 +56,11 @@ class HTMLPurifier_ConfigSchema_ValidatorAtom
}
return $this;
}
-
+
protected function error($msg) {
throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg);
}
-
-}
+}
+// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser
index 1ac5ff691eb70c078010f273ba80ef8619bb2034..1eaecd11f856504cde09c1b302c7c1cfd65ec00b 100644
GIT binary patch
delta 2360
zcmZuz%WoS+7;h4h*nzYGCC!7VD62xHBCOb^(5w$3wOz%+PE71dMI6d_ckB#V?<}*k
zc~Dh3aYaOX;=n2RLx)jSJs5v$MMqIeEYL?|Y74+P^*ic73Ay
zv-Q#3qjJTzTskC?C%YaCrB&OrEB9<`r{8IJBf*A@iYHyc11jWc8x`!T{WP>cw5@A*
zuen4Lt48e23i2xN+t#*}qIBN9RRACQ`^&|*&G)wF@nh=l(<3z6u%A8yqYb0@(_%68
z5dSl`cz!WkfH2BSeEs_J`OD?PrlD_4teuss3Dxw;z@x2(RU6nFwa_kqkO*3h2Oe<_
zbz*5mNLe|}N%!f9o&;8H7p;xkR--HEkeyh-1eEwwzMtB5Z!2M&JH*Rrs1zc}A967!
zvJ}6VSUf9Z8X2!1g_4hRCBXV*;sy%?k3g~g!$
This directive can be used to add custom auto-format injectors.
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.
div
tags (the behavior is slightly different outside of
the root node.)
This directive turns on linkification, auto-linking http, ftp and
https URLs. a
tags with the href
attribute
- must be allowed.
+ must be allowed.
a
tags
with the href
attribute must be allowed.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
index 9edf0d6256..aaede47d62 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
@@ -42,3 +42,4 @@ DEFAULT: false
if a tag looked empty on the way end, it will get removed; if HTML Purifier
made it empty, it will stay.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.txt
index c63fb69985..161a52ef48 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.txt
@@ -1,2 +1,3 @@
AutoFormat
DESCRIPTION: Configuration for activating auto-formatting functionality (also known as Injector
s)
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.PurifierLinkifyDocURL.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.PurifierLinkifyDocURL.txt
index 11d3b4e132..3e8309e39e 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.PurifierLinkifyDocURL.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.PurifierLinkifyDocURL.txt
@@ -7,6 +7,6 @@ DEFAULT: '#%s'
Location of configuration documentation to link to, let %s substitute into the configuration's namespace and directive names sans the percent - sign. + sign.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.txt index 95bffcd88f..6097a557e7 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/AutoFormatParam.txt @@ -1,2 +1,3 @@ AutoFormatParam DESCRIPTION: Configuration for customizing auto-formatting functionality +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt index 68fcde1bc8..b324608f76 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt @@ -5,3 +5,4 @@ VERSION: 3.1.0 --DESCRIPTION-- This parameter determines whether or not !important cascade modifiers should be allowed in user CSS. If false, !important will stripped. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt index 1b4f524b11..748be0eec8 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt @@ -8,3 +8,4 @@ values. Tricky CSS properties/values can drastically modify page layout or be used for deceptive practices but do not directly constitute a security risk. For example,display:none;
is considered a tricky property that
will only be allowed if this directive is set to true.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
index b06689745a..460112ebe0 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
@@ -5,13 +5,14 @@ DEFAULT: NULL
--DESCRIPTION--
- If HTML Purifier's style attributes set is unsatisfactory for your needs, - you 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 - usual feature set, so you cannot add an attribute that HTML Purifier never + If HTML Purifier's style attributes set is unsatisfactory for your needs, + you 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 + usual feature set, so you cannot add an attribute that HTML Purifier never supported in the first place.
- Warning: If another directive conflicts with the - elements here, that directive will win and override. + Warning: If another directive conflicts with the + elements here, that directive will win and override.
+--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt index 5b40de2a05..5cb7dda3ba 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt @@ -6,6 +6,6 @@ DEFAULT: 1Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. + %HTML.DefinitionRev for details.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt index 824111e74f..7a3291470c 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt @@ -13,3 +13,4 @@ VERSION: 3.1.1 subtle differences in the input format (the CSS max is a number with a unit). +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt index cc883dc578..148eedb8be 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt @@ -5,6 +5,6 @@ DEFAULT: false --DESCRIPTION--- Whether or not to allow safe, proprietary CSS values. + Whether or not to allow safe, proprietary CSS values.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.txt index 8bafc4b3c8..d14b490933 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.txt @@ -1,2 +1,3 @@ CSS DESCRIPTION: Configuration regarding allowed CSS. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt index 192db1f9e6..c486724c88 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt @@ -7,7 +7,8 @@ DEFAULT: 'Serializer' This directive defines which method to use when caching definitions, the complex data-type that makes HTML Purifier tick. Set to null to disable caching (not recommended, as you will see a definite -performance degradation). +performance degradation). --ALIASES-- Core.DefinitionCache +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt index 600c567ecf..54036507d6 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt @@ -8,6 +8,6 @@ DEFAULT: NULL Absolute path with no trailing slash to store serialized definitions in. Default is within the HTML Purifier library inside DefinitionCache/Serializer. This - path must be writable by the webserver. + path must be writable by the webserver. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.txt index 6edaae0c47..57f30239a0 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.txt @@ -1,2 +1,3 @@ Cache DESCRIPTION: Configuration for DefinitionCache and related subclasses. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt index 7fdca4924a..568cbf3b32 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt @@ -14,4 +14,5 @@ DEFAULT: trueNotice: This directive's default turned from false to true in HTML Purifier 3.2.0. -
\ No newline at end of file + +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt index ccaf2ae3d9..d7317911fa 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt @@ -8,4 +8,5 @@ Whether or not to collect errors found while filtering the document. This is a useful way to give feedback to your users. Warning: Currently this feature is very patchy and experimental, with lots of 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. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt index 6ec36dbbcd..08b381d34c 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt @@ -25,5 +25,4 @@ array ( Lookup array of color names to six digit hexadecimal number corresponding to color, with preceding hash mark. Used when parsing colors. - - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt index 3f832c1046..64b114fce2 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt @@ -11,3 +11,4 @@ processing is not necessary. --ALIASES-- Core.AcceptFullDocuments +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt index 1ecc663787..36f16e07ea 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt @@ -12,6 +12,6 @@ DEFAULT: 0 performance, and this is only strictly necessary if the counting 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 - not being used. + not being used. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt index ab75dbd995..8bfb47c3ac 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt @@ -12,3 +12,4 @@ entities), making it pretty useless for anything except the most I18N-blind applications, although %Core.EscapeNonASCIICharacters offers fixes this trouble with another tradeoff. This directive only accepts ISO-8859-1 if iconv is not enabled. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt index 554d6a249b..4d5b5055cd 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt @@ -7,3 +7,4 @@ 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 be preserved. There is no option for dropping the element but preserving child nodes. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt index 779a573ece..a7a5b249bb 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt @@ -4,3 +4,4 @@ DEFAULT: false --DESCRIPTION-- When true, invalid tags will be written back to the document as plain text. Otherwise, they are silently dropped. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt index 93b8a4b203..abb499948a 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt @@ -9,4 +9,5 @@ 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 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. -Anyway, use UTF-8! +Anyway, use UTF-8! +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt index f317221c8b..915391edb7 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt @@ -10,10 +10,10 @@ array (
This directive is a lookup array of elements which should have their
contents removed when they are not allowed by the HTML definition.
- For example, the contents of a script
tag are not
+ For example, the contents of a script
tag are not
normally shown in a document, so if script tags are to be removed,
their contents should be removed to. This is opposed to a b
tag, which defines some presentational changes but does not hide its
contents.
- This directive enables pre-emptive URI checking in img
- tags, as the attribute validation strategy is not authorized to
+ This directive enables pre-emptive URI checking in img
+ 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.
HTMLPurifier->addFilter()
method. Specify an array of concrete implementations.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
index aaa7416351..078d087417 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
@@ -27,15 +27,15 @@ EXTERNAL: CSSTidy
body {color:#F00;} Some text';
$config = HTMLPurifier_Config::createDefault();
$config->set('Filter', 'ExtractStyleBlocks', true);
$purifier = new HTMLPurifier($config);
-
+
$html = $purifier->purify($dirty);
-
+
// This implementation writes the stylesheets to the styles/ directory.
// You can also echo the styles inside the document, but it's a bit
// more difficult to make sure they get interpreted properly by
@@ -71,3 +71,4 @@ EXTERNAL: CSSTidy
height (somewhat reasonable). Whether or not these measures should be
used is left to the reader.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
index cbdc0068ca..7fa6536b2c 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
@@ -8,3 +8,4 @@ DEFAULT: false
this document
on embedding videos for more information on what this filter does.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.txt
index cf5f89cdc0..f2d25a1b26 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Filter.txt
@@ -1,2 +1,3 @@
Filter
DESCRIPTION: Directives for turning filters on and off, or specifying custom filters.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt
index 96ac5e5d1c..d436ed0158 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt
@@ -9,6 +9,6 @@ ALIASES: Filter.ExtractStyleBlocksEscaping
Whether or not to escape the dangerous characters <, > and &
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,
- where there is no risk of it being interpreted as HTML.
+ where there is no risk of it being interpreted as HTML.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt
index 366df44563..3943529c7b 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt
@@ -26,3 +26,4 @@ ALIASES: Filter.ExtractStyleBlocksScope
Purifier, and I am working to get it fixed. Until then, HTML Purifier
performs a basic check to prevent this.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt
index 78e69cbb5e..cafccf8b53 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt
@@ -12,3 +12,4 @@ DEFAULT: NULL
disable cleaning. In addition, you can supply your own concrete implementation
of Tidy's interface to use, although I don't know why you'd want to do that.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.txt
index 8e2bbe7c3d..dff9784b12 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/FilterParam.txt
@@ -1,2 +1,3 @@
FilterParam
DESCRIPTION: Configuration for filters.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
index 5fcd12441c..3e231d2d16 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
@@ -19,4 +19,4 @@ DEFAULT: NULL
broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes
are set, this directive has no effect.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
index 88e696e812..fcf093f17d 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
@@ -5,15 +5,15 @@ DEFAULT: NULL
--DESCRIPTION--
- If HTML Purifier's attribute set is unsatisfactory, overload it! - The syntax is "tag.attr" or "*.attr" for the global attributes + If HTML Purifier's attribute set is unsatisfactory, overload it! + The syntax is "tag.attr" or "*.attr" for the global attributes (style, id, class, dir, lang, xml:lang).
- Warning: If another directive conflicts with the - elements here, that directive will win and override. For - example, %HTML.EnableAttrID will take precedence over *.id in this - directive. You must set that directive to true before you can use - IDs at all. + Warning: If another directive conflicts with the + elements here, that directive will win and override. For + example, %HTML.EnableAttrID will take precedence over *.id in this + directive. You must set that directive to true before you can use + IDs at all.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt index b667b3da8b..888d558196 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt @@ -4,15 +4,15 @@ VERSION: 1.3.0 DEFAULT: NULL --DESCRIPTION--- 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 - 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 - supported in the first place (like embed, form or head). If 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 + 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 + supported in the first place (like embed, form or head). If you change this, you probably also want to change %HTML.AllowedAttributes.
- Warning: If another directive conflicts with the - elements here, that directive will win and override. + Warning: If another directive conflicts with the + elements here, that directive will win and override.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt index 85e39f7647..5a59a55c08 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt @@ -15,6 +15,6 @@ DEFAULT: NULL 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 by this directive. Modules defined in %HTML.CoreModules are not - affected by this directive. + affected by this directive. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt index e12edb6414..45ae469ec9 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt @@ -13,6 +13,6 @@ DEFAULT: 'p'<blockquote>Foo</blockquote>
would become
<blockquote><p>Foo</p></blockquote>
.
The <p>
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.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
index c629f66b45..5246188795 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
@@ -18,6 +18,6 @@ array (
that must be included for the doctype to be an conforming document
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
- protection, but this is not recommended.
+ protection, but this is not recommended.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
index ee410ff07c..a64e3d7c36 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
@@ -6,5 +6,4 @@ DEFAULT: NULL
A custom doctype for power-users who defined there own document
type. This directive only applies when %HTML.Doctype is blank.
-
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
index 36a3e9dab4..103db754a2 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
@@ -30,4 +30,4 @@ $def->addAttribute('a', 'tabindex', 'Number');
You must specify a value to this directive to use the
advanced API features.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
index bc084fa37f..229ae0267a 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
@@ -11,6 +11,6 @@ DEFAULT: 1
context: revision 3 is more up-to-date then revision 2. Thus, when
this gets incremented, the cache handling is smart enough to clean
up any older revisions of your definition as well as flush the
- cache.
+ cache.
-
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
index 051cf20a62..9dab497f2f 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
@@ -8,3 +8,4 @@ this name for sake of simplicity. When non-blank, this will override any
older directives like %HTML.XHTML or %HTML.Strict.
--ALLOWED--
'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1'
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
index 68c49cd616..57358f9bad 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
@@ -18,3 +18,4 @@ DEFAULT: array()
out that directive for a discussion of why you
should think twice before using this directive.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
index 1a9c90f4ab..93a53e14fb 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
@@ -17,3 +17,4 @@ DEFAULT: array()
a nasty surprise when people start using the background-image
CSS property.
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
index 15d8dceccd..e424c386ec 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
@@ -10,4 +10,5 @@ VERSION: 3.1.1
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).
-
\ No newline at end of file
+
+--# vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
index ecc2f77b60..62e8e160c7 100644
--- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
+++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
@@ -5,8 +5,8 @@ DEFAULT: 'div'
--DESCRIPTION--
- String name of element that HTML fragment passed to library will be - inserted in. An interesting variation would be using span as the - parent element, meaning that only inline tags would be allowed. + String name of element that HTML fragment passed to library will be + inserted in. An interesting variation would be using span as the + parent element, meaning that only inline tags would be allowed.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt index 9784c1c42d..dfb720496d 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt @@ -9,3 +9,4 @@ DEFAULT: false Warning: This can cause your documents to stop validating! +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt index 98ed8f9f0b..f635a68548 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt @@ -10,4 +10,5 @@ DEFAULT: false element and will cause your website to stop validating. You probably want to enable this with %HTML.SafeObject. Highly experimental. - \ No newline at end of file + +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt index 6270abea47..32967b88fb 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt @@ -6,8 +6,9 @@ DEFAULT: falseWhether or not to permit object 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 object tags. You may also want to + what websites like MySpace do to object tags. You may also want to enable %HTML.SafeEmbed for maximum interoperability with Internet Explorer, although embed tags will cause your website to stop validating. Highly experimental.
+--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt index c9697bde82..a8b1de56be 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt @@ -6,3 +6,4 @@ DEPRECATED-VERSION: 1.7.0 DEPRECATED-USE: HTML.Doctype --DESCRIPTION-- Determines whether or not to use Transitional (loose) or Strict rulesets. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt index 7fadf06c73..b4c271b7fa 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt @@ -4,5 +4,5 @@ VERSION: 2.0.0 DEFAULT: array() --DESCRIPTION-- -Fixes to add to the default set of Tidy fixes as per your level. - +Fixes to add to the default set of Tidy fixes as per your level. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt index 9383bbaaed..4186ccd0d1 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt @@ -21,3 +21,4 @@ There are four allowed values: --ALLOWED-- 'none', 'light', 'medium', 'heavy' +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt index 4717f39fdb..996762bd1d 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt @@ -4,5 +4,5 @@ VERSION: 2.0.0 DEFAULT: array() --DESCRIPTION-- -Fixes to remove from the default set of Tidy fixes as per your level. - +Fixes to remove from the default set of Tidy fixes as per your level. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt index 6a4015e7bf..89133b1a38 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt @@ -4,4 +4,5 @@ VERSION: 2.0.0 DEFAULT: false --DESCRIPTION-- Indicates whether or not the user input is trusted or not. If the input is -trusted, a more expansive set of allowed tags and attributes will be used. +trusted, a more expansive set of allowed tags and attributes will be used. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt index 8cca4b052a..2a47e384f4 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt @@ -8,3 +8,4 @@ DEPRECATED-USE: HTML.Doctype Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. --ALIASES-- Core.XHTML +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.txt index 9350008639..f32ceb5b6e 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.txt @@ -1,2 +1,3 @@ HTML DESCRIPTION: Configuration regarding allowed HTML. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt index 5a77edb4d2..08921fde70 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt @@ -4,6 +4,7 @@ VERSION: 2.0.0 DEFAULT: true --DESCRIPTION-- Determines whether or not HTML Purifier should attempt to fix up the -contents of script tags for legacy browsers with comments. +contents of script tags for legacy browsers with comments. --ALIASES-- Core.CommentScriptContents +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt index 2dd17999df..79f8ad82cf 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt @@ -8,6 +8,6 @@ DEFAULT: NULL Newline string to format final output with. If left null, HTML Purifier will auto-detect the default newline type of the system and use that; you can manually override it here. Remember, \r\n is Windows, \r - is Mac, and \n is Unix. + is Mac, and \n is Unix. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt index 5392b3bd51..232b02362a 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt @@ -11,3 +11,4 @@ DEFAULT: false to text diffs. If you're not seeing this bug, chances are, you don't need this directive. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt index 6d26c4ded9..06bab00a0a 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt @@ -4,7 +4,7 @@ VERSION: 1.1.1 DEFAULT: false --DESCRIPTION--- Determines whether or not to run Tidy on the final output for pretty + Determines whether or not to run Tidy on the final output for pretty formatting reasons, such as indentation and wrap.
@@ -22,3 +22,4 @@ DEFAULT: false
--ALIASES-- Core.TidyFormat +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.txt index abd4b1b39e..7849d60d26 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.txt @@ -1,2 +1,3 @@ Output DESCRIPTION: Configuration relating to the generation of (X)HTML. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt index 2cd7067ddc..071bc0295d 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt @@ -4,3 +4,4 @@ DEFAULT: false --DESCRIPTION-- When set to true, HTMLPurifier_Encoder will act as if iconv does not exist and use only pure PHP implementations. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.txt index a9928fec20..5025f9d14f 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Test.txt @@ -1,2 +1,3 @@ Test DESCRIPTION: Developer testing configuration for our unit tests. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt index cf1271c0eb..98fdfe9222 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt @@ -12,3 +12,4 @@ array ( --DESCRIPTION-- Whitelist that defines the schemes that a URI is allowed to have. This prevents XSS attacks from using pseudo-schemes like javascript or mocha. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt index f68b82596e..876f0680cf 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt @@ -9,9 +9,9 @@ DEFAULT: NULL inserted into. This information is important if HTML Purifier needs to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute is on. You may use a non-absolute URI for this value, but behavior - may vary (%URI.MakeAbsolute deals nicely with both absolute and + may vary (%URI.MakeAbsolute deals nicely with both absolute and relative paths, but forwards-compatibility is not guaranteed). Warning: If set, the scheme on this URI - overrides the one specified by %URI.DefaultScheme. + overrides the one specified by %URI.DefaultScheme. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt index ba472edadc..728e378cbe 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt @@ -4,7 +4,7 @@ DEFAULT: 'http' --DESCRIPTION--- Defines through what scheme the output will be served, in order to + Defines through what scheme the output will be served, in order to select the proper object validator when no scheme information is present.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt index dd324a5923..f05312ba86 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt @@ -8,4 +8,4 @@ DEFAULT: NULL Unique identifier for a custom-built URI definition. If you want to add custom URIFilters, you must specify this value. - +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt index 9049897b66..80cfea93f7 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt @@ -6,6 +6,6 @@ DEFAULT: 1Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. + %HTML.DefinitionRev for details.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt index 85fe3df10a..71ce025a2d 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt @@ -5,9 +5,10 @@ DEFAULT: false --DESCRIPTION--- Disables all URIs in all forms. Not sure why you'd want to do that - (after all, the Internet's founded on the notion of a hyperlink). + Disables all URIs in all forms. Not sure why you'd want to do that + (after all, the Internet's founded on the notion of a hyperlink).
--ALIASES-- Attr.DisableURI +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt index 5f9dc31f9f..13c122c8ce 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt @@ -7,4 +7,5 @@ Disables links to external websites. This is a highly effective anti-spam and anti-pagerank-leech measure, but comes at a hefty price: nolinks or images outside of your domain will be allowed. Non-linkified URIs will still be preserved. If you want to be able to link to subdomains or use -absolute URIs, specify %URI.Host for your website. +absolute URIs, specify %URI.Host for your website. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt index af43b61402..abcc1efd61 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt @@ -9,4 +9,5 @@ tracking (good for email viewers), bandwidth leeching, cross-site request forging, goatse.cx posting, and other nasties, but also results in a loss of end-user functionality (they can't directly post a pic they posted from Flickr anymore). Use it if you don't have a robust user-content moderation -team. +team. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt index 2f4e57417a..51e6ea91f7 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt @@ -6,7 +6,7 @@ DEFAULT: falseDisables embedding resources, essentially meaning no pictures. You can - still link to them though. See %URI.DisableExternalResources for why - this might be a good idea. + still link to them though. See %URI.DisableExternalResources for why + this might be a good idea.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt index 4815940753..ee83b121de 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt @@ -5,15 +5,15 @@ DEFAULT: NULL --DESCRIPTION--- Defines the domain name of the server, so we can determine whether or - an absolute URI is from your website or not. Not strictly necessary, - as users should be using relative URIs to reference resources on your - website. It will, however, let you use absolute URIs to link to - subdomains of the domain you post here: i.e. example.com will allow - sub.example.com. However, higher up domains will still be excluded: - if you set %URI.Host to sub.example.com, example.com will be blocked. + Defines the domain name of the server, so we can determine whether or + an absolute URI is from your website or not. Not strictly necessary, + as users should be using relative URIs to reference resources on your + website. It will, however, let you use absolute URIs to link to + subdomains of the domain you post here: i.e. example.com will allow + sub.example.com. However, higher up domains will still be excluded: + if you set %URI.Host to sub.example.com, example.com will be blocked. Note: This directive overrides %URI.Base because a given page may be on a sub-domain, but you wish HTML Purifier to be more relaxed and allow some of the parent domains too.
- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt index a62a354374..0b6df7625d 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt @@ -5,4 +5,5 @@ DEFAULT: array() --DESCRIPTION-- List of strings that are forbidden in the host of any URI. Use it to kill domain names of spam, etc. Note that it will catch anything in the domain, -so moo.com will catch moo.com.example.com. +so moo.com will catch moo.com.example.com. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt index 0832b2cc67..4214900a59 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt @@ -10,3 +10,4 @@ DEFAULT: false viewed in a different context (and setting an alternate base URI is not possible). %URI.Base must be set for this directive to work. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt index ed9e142d8b..58c81dcc44 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt @@ -7,8 +7,8 @@ DEFAULT: NULL
Munges all browsable (usually http, https and ftp)
absolute URIs into another URI, usually a URI redirection service.
- This directive accepts a URI, formatted with a %s
where
- the url-encoded original URI should be inserted (sample:
+ This directive accepts a URI, formatted with a %s
where
+ the url-encoded original URI should be inserted (sample:
http://www.google.com/url?q=%s
).
@@ -16,10 +16,10 @@ DEFAULT: NULL
Remember this has no effect if %URI.Munge is not on.
+--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt index e910ee5403..23331a4e79 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt @@ -6,3 +6,4 @@ If this is set to true (which it is by default), you can override %URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the registry. If false, you will also have to update that directive in order to add more schemes. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.txt b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.txt index 4bcdb95b1f..a13060f365 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.txt +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.txt @@ -1,2 +1,3 @@ URI DESCRIPTION: Features regarding Uniform Resource Identifiers. +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/info.ini b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/info.ini index cd67189232..5de4505e1b 100644 --- a/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/info.ini +++ b/lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/info.ini @@ -1 +1,3 @@ name = "HTML Purifier" + +; vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ContentSets.php b/lib/htmlpurifier/HTMLPurifier/ContentSets.php index 15c8d97fee..3b6e96f5f5 100644 --- a/lib/htmlpurifier/HTMLPurifier/ContentSets.php +++ b/lib/htmlpurifier/HTMLPurifier/ContentSets.php @@ -5,18 +5,18 @@ */ class HTMLPurifier_ContentSets { - + /** * List of content set strings (pipe seperators) indexed by name. */ public $info = array(); - + /** * List of content set lookups (element => true) indexed by name. * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets */ public $lookup = array(); - + /** * Synchronized list of defined content sets (keys of info) */ @@ -25,7 +25,7 @@ class HTMLPurifier_ContentSets * Synchronized list of defined content values (values of info) */ protected $values = array(); - + /** * Merges in module's content sets, expands identifiers in the content * sets and populates the keys, values and lookup member variables. @@ -60,14 +60,14 @@ class HTMLPurifier_ContentSets $this->lookup[$i] += $add; } } - + foreach ($this->lookup as $key => $lookup) { $this->info[$key] = implode(' | ', array_keys($lookup)); } $this->keys = array_keys($this->info); $this->values = array_values($this->info); } - + /** * Accepts a definition; generates and assigns a ChildDef for it * @param $def HTMLPurifier_ElementDef reference @@ -88,11 +88,11 @@ class HTMLPurifier_ContentSets } $def->child = $this->getChildDef($def, $module); } - + public function generateChildDefCallback($matches) { return $this->info[$matches[0]]; } - + /** * Instantiates a ChildDef based on content_model and content_model_type * member variables in HTMLPurifier_ElementDef @@ -134,7 +134,7 @@ class HTMLPurifier_ContentSets ); return false; } - + /** * Converts a string list of elements separated by pipes into * a lookup array. @@ -149,6 +149,7 @@ class HTMLPurifier_ContentSets } return $ret; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/Context.php b/lib/htmlpurifier/HTMLPurifier/Context.php index 151a68eda8..9ddf0c5476 100644 --- a/lib/htmlpurifier/HTMLPurifier/Context.php +++ b/lib/htmlpurifier/HTMLPurifier/Context.php @@ -9,12 +9,12 @@ */ class HTMLPurifier_Context { - + /** * Private array that stores the references. */ private $_storage = array(); - + /** * Registers a variable into the context. * @param $name String name @@ -28,7 +28,7 @@ class HTMLPurifier_Context } $this->_storage[$name] =& $ref; } - + /** * Retrieves a variable reference from the context. * @param $name String name @@ -45,7 +45,7 @@ class HTMLPurifier_Context } return $this->_storage[$name]; } - + /** * Destorys a variable in the context. * @param $name String name @@ -58,7 +58,7 @@ class HTMLPurifier_Context } unset($this->_storage[$name]); } - + /** * Checks whether or not the variable exists. * @param $name String name @@ -66,7 +66,7 @@ class HTMLPurifier_Context public function exists($name) { return isset($this->_storage[$name]); } - + /** * Loads a series of variables from an associative array * @param $context_array Assoc array of variables to load @@ -76,6 +76,7 @@ class HTMLPurifier_Context $this->register($key, $context_array[$key]); } } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/Definition.php b/lib/htmlpurifier/HTMLPurifier/Definition.php index 7de8b73d7f..a7408c9749 100644 --- a/lib/htmlpurifier/HTMLPurifier/Definition.php +++ b/lib/htmlpurifier/HTMLPurifier/Definition.php @@ -6,24 +6,24 @@ */ abstract class HTMLPurifier_Definition { - + /** * Has setup() been called yet? */ public $setup = false; - + /** * What type of definition is it? */ public $type; - + /** * Sets up the definition object into the final form, something * not done by the constructor * @param $config HTMLPurifier_Config instance */ abstract protected function doSetup($config); - + /** * Setup function that aborts if already setup * @param $config HTMLPurifier_Config instance @@ -33,6 +33,7 @@ abstract class HTMLPurifier_Definition $this->setup = true; $this->doSetup($config); } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache.php index f81af0c56a..fa5a087bb7 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache.php @@ -10,9 +10,9 @@ */ abstract class HTMLPurifier_DefinitionCache { - + public $type; - + /** * @param $name Type of definition objects this instance of the * cache will handle. @@ -20,7 +20,7 @@ abstract class HTMLPurifier_DefinitionCache public function __construct($type) { $this->type = $type; } - + /** * Generates a unique identifier for a particular configuration * @param Instance of HTMLPurifier_Config @@ -30,7 +30,7 @@ abstract class HTMLPurifier_DefinitionCache $config->getBatchSerial($this->type) . ',' . $config->get($this->type, 'DefinitionRev'); } - + /** * Tests whether or not a key is old with respect to the configuration's * version and revision number. @@ -50,7 +50,7 @@ abstract class HTMLPurifier_DefinitionCache ) return true; return false; } - + /** * Checks if a definition's type jives with the cache's type * @note Throws an error on failure @@ -64,37 +64,37 @@ abstract class HTMLPurifier_DefinitionCache } return true; } - + /** * Adds a definition object to the cache */ abstract public function add($def, $config); - + /** * Unconditionally saves a definition object to the cache */ abstract public function set($def, $config); - + /** * Replace an object in the cache */ abstract public function replace($def, $config); - + /** * Retrieves a definition object from the cache */ abstract public function get($config); - + /** * Removes a definition object to the cache */ abstract public function remove($config); - + /** * Clears all objects from cache */ abstract public function flush($config); - + /** * Clears all expired (older version or revision) objects from cache * @note Be carefuly implementing this method as flush. Flush must @@ -102,6 +102,7 @@ abstract class HTMLPurifier_DefinitionCache * should not be repeatedly called by userland code. */ abstract public function cleanup($config); - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator.php index 39eb474f9a..b0fb6d0cd6 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator.php @@ -2,14 +2,14 @@ class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCache { - + /** * Cache object we are decorating */ public $cache; - + public function __construct() {} - + /** * Lazy decorator function * @param $cache Reference to cache object to decorate @@ -21,41 +21,42 @@ class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCach $decorator->type = $cache->type; return $decorator; } - + /** * Cross-compatible clone substitute */ public function copy() { return new HTMLPurifier_DefinitionCache_Decorator(); } - + public function add($def, $config) { return $this->cache->add($def, $config); } - + public function set($def, $config) { return $this->cache->set($def, $config); } - + public function replace($def, $config) { return $this->cache->replace($def, $config); } - + public function get($config) { return $this->cache->get($config); } - + public function remove($config) { return $this->cache->remove($config); } - + public function flush($config) { return $this->cache->flush($config); } - + public function cleanup($config) { return $this->cache->cleanup($config); } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php index 842382e417..d4cc35c4bc 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php @@ -7,36 +7,37 @@ class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends HTMLPurifier_DefinitionCache_Decorator { - + public $name = 'Cleanup'; - + public function copy() { return new HTMLPurifier_DefinitionCache_Decorator_Cleanup(); } - + public function add($def, $config) { $status = parent::add($def, $config); if (!$status) parent::cleanup($config); return $status; } - + public function set($def, $config) { $status = parent::set($def, $config); if (!$status) parent::cleanup($config); return $status; } - + public function replace($def, $config) { $status = parent::replace($def, $config); if (!$status) parent::cleanup($config); return $status; } - + public function get($config) { $ret = parent::get($config); if (!$ret) parent::cleanup($config); return $ret; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Memory.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Memory.php index 83ed2c0353..18f16d32b6 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Memory.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Memory.php @@ -2,44 +2,45 @@ /** * Definition cache decorator class that saves all cache retrievals - * to PHP's memory; good for unit tests or circumstances where + * to PHP's memory; good for unit tests or circumstances where * there are lots of configuration objects floating around. */ class HTMLPurifier_DefinitionCache_Decorator_Memory extends HTMLPurifier_DefinitionCache_Decorator { - + protected $definitions; public $name = 'Memory'; - + public function copy() { return new HTMLPurifier_DefinitionCache_Decorator_Memory(); } - + public function add($def, $config) { $status = parent::add($def, $config); if ($status) $this->definitions[$this->generateKey($config)] = $def; return $status; } - + public function set($def, $config) { $status = parent::set($def, $config); if ($status) $this->definitions[$this->generateKey($config)] = $def; return $status; } - + public function replace($def, $config) { $status = parent::replace($def, $config); if ($status) $this->definitions[$this->generateKey($config)] = $def; return $status; } - + public function get($config) { $key = $this->generateKey($config); if (isset($this->definitions[$key])) return $this->definitions[$key]; $this->definitions[$key] = parent::get($config); return $this->definitions[$key]; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in index d741764c86..21a8fcfda2 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in @@ -8,39 +8,40 @@ require_once 'HTMLPurifier/DefinitionCache/Decorator.php'; class HTMLPurifier_DefinitionCache_Decorator_Template extends HTMLPurifier_DefinitionCache_Decorator { - + var $name = 'Template'; // replace this - + function copy() { // replace class name with yours return new HTMLPurifier_DefinitionCache_Decorator_Template(); } - + // remove methods you don't need - + function add($def, $config) { return parent::add($def, $config); } - + function set($def, $config) { return parent::set($def, $config); } - + function replace($def, $config) { return parent::replace($def, $config); } - + function get($config) { return parent::get($config); } - + function flush() { return parent::flush(); } - + function cleanup($config) { return parent::cleanup($config); } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Null.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Null.php index 8e39e69d7b..41d97e734f 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Null.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Null.php @@ -5,34 +5,35 @@ */ class HTMLPurifier_DefinitionCache_Null extends HTMLPurifier_DefinitionCache { - + public function add($def, $config) { return false; } - + public function set($def, $config) { return false; } - + public function replace($def, $config) { return false; } - + public function remove($config) { return false; } - + public function get($config) { return false; } - + public function flush($config) { return false; } - + public function cleanup($config) { return false; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php index ef082217a5..acbbe2c3b3 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php @@ -3,7 +3,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCache { - + public function add($def, $config) { if (!$this->checkDefType($def)) return; $file = $this->generateFilePath($config); @@ -11,14 +11,14 @@ class HTMLPurifier_DefinitionCache_Serializer extends if (!$this->_prepareDir($config)) return false; return $this->_write($file, serialize($def)); } - + public function set($def, $config) { if (!$this->checkDefType($def)) return; $file = $this->generateFilePath($config); if (!$this->_prepareDir($config)) return false; return $this->_write($file, serialize($def)); } - + public function replace($def, $config) { if (!$this->checkDefType($def)) return; $file = $this->generateFilePath($config); @@ -26,19 +26,19 @@ class HTMLPurifier_DefinitionCache_Serializer extends if (!$this->_prepareDir($config)) return false; return $this->_write($file, serialize($def)); } - + public function get($config) { $file = $this->generateFilePath($config); if (!file_exists($file)) return false; return unserialize(file_get_contents($file)); } - + public function remove($config) { $file = $this->generateFilePath($config); if (!file_exists($file)) return false; return unlink($file); } - + public function flush($config) { if (!$this->_prepareDir($config)) return false; $dir = $this->generateDirectoryPath($config); @@ -49,7 +49,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends unlink($dir . '/' . $filename); } } - + public function cleanup($config) { if (!$this->_prepareDir($config)) return false; $dir = $this->generateDirectoryPath($config); @@ -61,7 +61,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends if ($this->isOld($key, $config)) unlink($dir . '/' . $filename); } } - + /** * Generates the file path to the serial file corresponding to * the configuration and definition name @@ -71,7 +71,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends $key = $this->generateKey($config); return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; } - + /** * Generates the path to the directory contain this cache's serial files * @note No trailing slash @@ -81,7 +81,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends $base = $this->generateBaseDirectoryPath($config); return $base . '/' . $this->type; } - + /** * Generates path to base directory that contains all definition type * serials @@ -92,7 +92,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; return $base; } - + /** * Convenience wrapper function for file_put_contents * @param $file File name to write to @@ -102,7 +102,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends private function _write($file, $data) { return file_put_contents($file, $data); } - + /** * Prepares the directory that this type stores the serials in * @return True if successful @@ -114,7 +114,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends if (!is_dir($base)) { trigger_error('Base directory '.$base.' does not exist, please create or change using %Cache.SerializerPath', - E_USER_ERROR); + E_USER_WARNING); return false; } elseif (!$this->_testPermissions($base)) { return false; @@ -127,7 +127,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends } return true; } - + /** * Tests permissions on a directory and throws out friendly * error messages and attempts to chmod it itself if possible @@ -139,7 +139,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends // generally, you'll want to handle this beforehand // so a more specific error message can be given trigger_error('Directory '.$dir.' does not exist', - E_USER_ERROR); + E_USER_WARNING); return false; } if (function_exists('posix_getuid')) { @@ -157,15 +157,16 @@ class HTMLPurifier_DefinitionCache_Serializer extends } trigger_error('Directory '.$dir.' not writable, '. 'please chmod to ' . $chmod, - E_USER_ERROR); + E_USER_WARNING); } else { // generic error message trigger_error('Directory '.$dir.' not writable, '. 'please alter file permissions', - E_USER_ERROR); + E_USER_WARNING); } return false; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README index 962b80a341..2e35c1c3d0 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README @@ -1 +1,3 @@ This is a dummy file to prevent Git from ignoring this empty directory. + + vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DefinitionCacheFactory.php b/lib/htmlpurifier/HTMLPurifier/DefinitionCacheFactory.php index fca1b6c40e..3adefbb661 100644 --- a/lib/htmlpurifier/HTMLPurifier/DefinitionCacheFactory.php +++ b/lib/htmlpurifier/HTMLPurifier/DefinitionCacheFactory.php @@ -5,18 +5,18 @@ */ class HTMLPurifier_DefinitionCacheFactory { - + protected $caches = array('Serializer' => array()); protected $implementations = array(); protected $decorators = array(); - + /** * Initialize default decorators */ public function setup() { $this->addDecorator('Cleanup'); } - + /** * Retrieves an instance of global definition cache factory. */ @@ -30,16 +30,16 @@ class HTMLPurifier_DefinitionCacheFactory } return $instance; } - + /** * Registers a new definition cache object * @param $short Short name of cache object, for reference - * @param $long Full class name of cache object, for construction + * @param $long Full class name of cache object, for construction */ public function register($short, $long) { $this->implementations[$short] = $long; } - + /** * Factory method that creates a cache object based on configuration * @param $name Name of definitions handled by cache @@ -73,10 +73,10 @@ class HTMLPurifier_DefinitionCacheFactory $this->caches[$method][$type] = $cache; return $this->caches[$method][$type]; } - + /** * Registers a decorator to add to all new cache objects - * @param + * @param */ public function addDecorator($decorator) { if (is_string($decorator)) { @@ -85,6 +85,7 @@ class HTMLPurifier_DefinitionCacheFactory } $this->decorators[$decorator->name] = $decorator; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/Doctype.php b/lib/htmlpurifier/HTMLPurifier/Doctype.php index 5e83a86989..1e3c574c06 100644 --- a/lib/htmlpurifier/HTMLPurifier/Doctype.php +++ b/lib/htmlpurifier/HTMLPurifier/Doctype.php @@ -12,38 +12,38 @@ class HTMLPurifier_Doctype * Full name of doctype */ public $name; - + /** * List of standard modules (string identifiers or literal objects) * that this doctype uses */ public $modules = array(); - + /** * List of modules to use for tidying up code */ public $tidyModules = array(); - + /** * Is the language derived from XML (i.e. XHTML)? */ public $xml = true; - + /** * List of aliases for this doctype */ public $aliases = array(); - + /** * Public DTD identifier */ public $dtdPublic; - + /** * System DTD identifier */ public $dtdSystem; - + public function __construct($name = null, $xml = true, $modules = array(), $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null ) { @@ -57,3 +57,4 @@ class HTMLPurifier_Doctype } } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/DoctypeRegistry.php b/lib/htmlpurifier/HTMLPurifier/DoctypeRegistry.php index 6c969efc5b..d6552aa550 100644 --- a/lib/htmlpurifier/HTMLPurifier/DoctypeRegistry.php +++ b/lib/htmlpurifier/HTMLPurifier/DoctypeRegistry.php @@ -2,17 +2,17 @@ class HTMLPurifier_DoctypeRegistry { - + /** * Hash of doctype names to doctype objects */ protected $doctypes; - + /** * Lookup table of aliases to real doctype names */ protected $aliases; - + /** * Registers a doctype to the registry * @note Accepts a fully-formed doctype object, or the @@ -45,7 +45,7 @@ class HTMLPurifier_DoctypeRegistry if (isset($this->aliases[$name])) unset($this->aliases[$name]); return $doctype; } - + /** * Retrieves reference to a doctype of a certain name * @note This function resolves aliases @@ -62,7 +62,7 @@ class HTMLPurifier_DoctypeRegistry } return $this->doctypes[$doctype]; } - + /** * Creates a doctype based on a configuration object, * will perform initialization on the doctype @@ -74,7 +74,7 @@ class HTMLPurifier_DoctypeRegistry public function make($config) { return clone $this->get($this->getDoctypeFromConfig($config)); } - + /** * Retrieves the doctype from the configuration object */ @@ -97,6 +97,7 @@ class HTMLPurifier_DoctypeRegistry } return $doctype; } - + } +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/ElementDef.php b/lib/htmlpurifier/HTMLPurifier/ElementDef.php index 341ce349d6..b55c7bd793 100644 --- a/lib/htmlpurifier/HTMLPurifier/ElementDef.php +++ b/lib/htmlpurifier/HTMLPurifier/ElementDef.php @@ -5,16 +5,18 @@ * HTMLPurifier_HTMLDefinition and HTMLPurifier_HTMLModule. * @note This class is inspected by HTMLPurifier_Printer_HTMLDefinition. * Please update that class too. + * @warning If you add new properties to this class, you MUST update + * the mergeIn() method. */ class HTMLPurifier_ElementDef { - + /** * Does the definition work by itself, or is it created solely * for the purpose of merging into another definition? */ public $standalone = true; - + /** * Associative array of attribute name to HTMLPurifier_AttrDef * @note Before being processed by HTMLPurifier_AttrCollections @@ -27,22 +29,22 @@ class HTMLPurifier_ElementDef * HTMLPurifier_HTMLDefinition->setup() processing. */ public $attr = array(); - + /** * Indexed list of tag's HTMLPurifier_AttrTransform to be done before validation */ public $attr_transform_pre = array(); - + /** * Indexed list of tag's HTMLPurifier_AttrTransform to be done after validation */ public $attr_transform_post = array(); - + /** * HTMLPurifier_ChildDef of this tag. */ public $child; - + /** * Abstract string representation of internal ChildDef rules. See * HTMLPurifier_ContentSets for how this is parsed and then transformed @@ -51,7 +53,7 @@ class HTMLPurifier_ElementDef * being processed by HTMLDefinition */ public $content_model; - + /** * Value of $child->type, used to determine which ChildDef to use, * used in combination with $content_model. @@ -60,23 +62,23 @@ class HTMLPurifier_ElementDef * being processed by HTMLDefinition */ public $content_model_type; - - - + + + /** * Does the element have a content model (#PCDATA | Inline)*? This - * is important for chameleon ins and del processing in + * is important for chameleon ins and del processing in * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't * have to worry about this one. */ public $descendants_are_inline = false; - + /** * List of the names of required attributes this element has. Dynamically * populated by HTMLPurifier_HTMLDefinition::getElement */ public $required_attr = array(); - + /** * Lookup table of tags excluded from all descendants of this tag. * @note SGML permits exclusions for all descendants, but this is @@ -89,7 +91,18 @@ class HTMLPurifier_ElementDef * distinctions. */ public $excludes = array(); - + + /** + * This tag is explicitly auto-closed by the following tags. + */ + public $autoclose = array(); + + /** + * Whether or not this is a formatting element affected by the + * "Active Formatting Elements" algorithm. + */ + public $formatting; + /** * Low-level factory constructor for creating new standalone element defs */ @@ -100,14 +113,14 @@ class HTMLPurifier_ElementDef $def->attr = $attr; return $def; } - + /** * Merges the values of another element definition into this one. * Values from the new element def take precedence if a value is * not mergeable. */ public function mergeIn($def) { - + // later keys takes precedence foreach($def->attr as $k => $v) { if ($k === 0) { @@ -127,7 +140,7 @@ class HTMLPurifier_ElementDef $this->_mergeAssocArray($this->attr_transform_pre, $def->attr_transform_pre); $this->_mergeAssocArray($this->attr_transform_post, $def->attr_transform_post); $this->_mergeAssocArray($this->excludes, $def->excludes); - + if(!empty($def->content_model)) { $this->content_model .= ' | ' . $def->content_model; $this->child = false; @@ -137,10 +150,11 @@ class HTMLPurifier_ElementDef $this->child = false; } if(!is_null($def->child)) $this->child = $def->child; + if(!is_null($def->formatting)) $this->formatting = $def->formatting; if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline; - + } - + /** * Merges one array into another, removes values which equal false * @param $a1 Array by reference that is merged into @@ -155,7 +169,7 @@ class HTMLPurifier_ElementDef $a1[$k] = $v; } } - -} +} +// vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/HTMLPurifier/Encoder.php b/lib/htmlpurifier/HTMLPurifier/Encoder.php index c2df313254..79a42d26ec 100644 --- a/lib/htmlpurifier/HTMLPurifier/Encoder.php +++ b/lib/htmlpurifier/HTMLPurifier/Encoder.php @@ -6,31 +6,31 @@ */ class HTMLPurifier_Encoder { - + /** * Constructor throws fatal error if you attempt to instantiate class */ private function __construct() { trigger_error('Cannot instantiate encoder, call methods statically', E_USER_ERROR); } - + /** * Error-handler that mutes errors, alternative to shut-up operator. */ private static function muteErrorHandler() {} - + /** * Cleans a UTF-8 string for well-formedness and SGML validity - * + * * It will parse according to UTF-8 and return a valid UTF8 string, with * non-SGML codepoints excluded. - * + * * @note Just for reference, the non-SGML code points are 0 to 31 and * 127 to 159, inclusive. However, we allow code points 9, 10 * and 13, which are the tab, line feed and carriage return * respectively. 128 and above the code points map to multibyte * UTF-8 representations. - * + * * @note Fallback code adapted from utf8ToUnicode by Henri Sivonen and * hsivonen@iki.fi at' . $this->locale->getMessage('ErrorCollector: No errors') . '
'; } else { return '