diff --git a/CHANGELOG.md b/CHANGELOG.md index 1969602bc..6e36c221d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## Unreleased +### Changed +- Update htmlpurifier library to 4.17.0 ## 1.2.23 ### Added diff --git a/mailscanner/lib/htmlpurifier/HTMLPurifier.standalone.php b/mailscanner/lib/htmlpurifier/HTMLPurifier.standalone.php index 0a7b1491d..6114522c1 100644 --- a/mailscanner/lib/htmlpurifier/HTMLPurifier.standalone.php +++ b/mailscanner/lib/htmlpurifier/HTMLPurifier.standalone.php @@ -7,7 +7,7 @@ * primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS * FILE, changes will be overwritten the next time the script is run. * - * @version 4.13.0 + * @version 4.17.0 * * @warning * You must *not* include any other HTML Purifier files before this file, @@ -39,7 +39,7 @@ */ /* - HTML Purifier 4.13.0 - Standards Compliant HTML Filtering + HTML Purifier 4.17.0 - Standards Compliant HTML Filtering Copyright (C) 2006-2008 Edward Z. Yang This library is free software; you can redistribute it and/or @@ -78,12 +78,12 @@ class HTMLPurifier * Version of HTML Purifier. * @type string */ - public $version = '4.13.0'; + public $version = '4.17.0'; /** * Constant with version of HTML Purifier. */ - const VERSION = '4.13.0'; + const VERSION = '4.17.0'; /** * Global configuration object. @@ -96,7 +96,7 @@ class HTMLPurifier * for backwards compatibility. * @type HTMLPurifier_Filter[] */ - private $filters = []; + private $filters = array(); /** * Single instance of HTML Purifier. @@ -200,7 +200,7 @@ public function purify($html, $config = null) $filter_flags = $config->getBatch('Filter'); $custom_filters = $filter_flags['Custom']; unset($filter_flags['Custom']); - $filters = []; + $filters = array(); foreach ($filter_flags as $filter => $flag) { if (!$flag) { continue; @@ -259,8 +259,8 @@ public function purify($html, $config = null) */ public function purifyArray($array_of_html, $config = null) { - $context_array = []; - $array = []; + $context_array = array(); + $array = array(); foreach($array_of_html as $key=>$value){ if (is_array($value)) { $array[$key] = $this->purifyArray($value, $config); @@ -330,7 +330,7 @@ class HTMLPurifier_Arborize public static function arborize($tokens, $config, $context) { $definition = $config->getHTMLDefinition(); $parent = new HTMLPurifier_Token_Start($definition->info_parent); - $stack = [$parent->toNode()]; + $stack = array($parent->toNode()); foreach ($tokens as $token) { $token->skip = null; // [MUT] $token->carryover = null; // [MUT] @@ -356,9 +356,9 @@ public static function arborize($tokens, $config, $context) { public static function flatten($node, $config, $context) { $level = 0; - $nodes = [$level => new HTMLPurifier_Queue([$node])]; - $closingTokens = []; - $tokens = []; + $nodes = array($level => new HTMLPurifier_Queue(array($node))); + $closingTokens = array(); + $tokens = array(); do { while (!$nodes[$level]->isEmpty()) { $node = $nodes[$level]->shift(); // FIFO @@ -401,7 +401,7 @@ class HTMLPurifier_AttrCollections * Associative array of attribute collections, indexed by name. * @type array */ - public $info = []; + public $info = array(); /** * Performs all expansions on internal data for use by other inclusions @@ -421,7 +421,7 @@ public function doConstruct($attr_types, $modules) foreach ($modules as $module) { foreach ($module->attr_collections as $coll_i => $coll) { if (!isset($this->info[$coll_i])) { - $this->info[$coll_i] = []; + $this->info[$coll_i] = array(); } foreach ($coll as $attr_i => $attr) { if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) { @@ -456,7 +456,7 @@ public function performInclusions(&$attr) return; } $merge = $attr[0]; - $seen = []; // recursion guard + $seen = array(); // recursion guard // loop through all the inclusions for ($i = 0; isset($merge[$i]); $i++) { if (isset($seen[$merge[$i]])) { @@ -491,7 +491,7 @@ public function expandIdentifiers(&$attr, $attr_types) { // because foreach will process new elements we add, make sure we // skip duplicates - $processed = []; + $processed = array(); foreach ($attr as $def_i => $def) { // skip inclusions @@ -599,7 +599,7 @@ abstract public function validate($string, $config, $context); public function parseCDATA($string) { $string = trim($string); - $string = str_replace(["\n", "\t", "\r"], ' ', $string); + $string = str_replace(array("\n", "\t", "\r"), ' ', $string); return $string; } @@ -754,7 +754,7 @@ class HTMLPurifier_AttrTypes * Lookup array of attribute string identifiers to concrete implementations. * @type HTMLPurifier_AttrDef[] */ - protected $info = []; + protected $info = array(); /** * Constructs the info array, supplying default implementations for attribute @@ -786,6 +786,7 @@ public function __construct() $this->info['IAlign'] = self::makeEnum('top,middle,bottom,left,right'); $this->info['LAlign'] = self::makeEnum('top,bottom,left,right'); $this->info['FrameTarget'] = new HTMLPurifier_AttrDef_HTML_FrameTarget(); + $this->info['ContentEditable'] = new HTMLPurifier_AttrDef_HTML_ContentEditable(); // unimplemented aliases $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); @@ -1023,7 +1024,7 @@ public function validateToken($token, $config, $context) // constants are slow, so we use as few as possible if (!defined('HTMLPURIFIER_PREFIX')) { - define('HTMLPURIFIER_PREFIX', __DIR__ . '/standalone'); + define('HTMLPURIFIER_PREFIX', dirname(__FILE__) . '/standalone'); set_include_path(HTMLPURIFIER_PREFIX . PATH_SEPARATOR . get_include_path()); } @@ -1100,45 +1101,12 @@ public static function getPath($class) */ public static function registerAutoload() { - $autoload = ['HTMLPurifier_Bootstrap', 'autoload']; - if (($funcs = spl_autoload_functions()) === false) { + $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); + if (spl_autoload_functions() === false) { spl_autoload_register($autoload); - } elseif (function_exists('spl_autoload_unregister')) { - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - // prepend flag exists, no need for shenanigans - spl_autoload_register($autoload, true, true); - } else { - $buggy = version_compare(PHP_VERSION, '5.2.11', '<'); - $compat = version_compare(PHP_VERSION, '5.1.2', '<=') && - version_compare(PHP_VERSION, '5.1.0', '>='); - foreach ($funcs as $func) { - if ($buggy && is_array($func)) { - // :TRICKY: There are some compatibility issues and some - // places where we need to error out - $reflector = new ReflectionMethod($func[0], $func[1]); - if (!$reflector->isStatic()) { - throw new Exception( - 'HTML Purifier autoloader registrar is not compatible - with non-static object methods due to PHP Bug #44144; - Please do not use HTMLPurifier.autoload.php (or any - file that includes this file); instead, place the code: - spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) - after your own autoloaders.' - ); - } - // Suprisingly, spl_autoload_register supports the - // Class::staticMethod callback format, although call_user_func doesn't - if ($compat) { - $func = implode('::', $func); - } - } - spl_autoload_unregister($func); - } - spl_autoload_register($autoload); - foreach ($funcs as $func) { - spl_autoload_register($func); - } - } + } else { + // prepend flag exists, no need for shenanigans + spl_autoload_register($autoload, true, true); } } } @@ -1312,6 +1280,22 @@ protected function doSetup($config) ); $this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); + $this->info['background-size'] = new HTMLPurifier_AttrDef_CSS_Composite( + [ + new HTMLPurifier_AttrDef_Enum( + [ + 'auto', + 'cover', + 'contain', + 'initial', + 'inherit', + ] + ), + new HTMLPurifier_AttrDef_CSS_Percentage(), + new HTMLPurifier_AttrDef_CSS_Length() + ] + ); + $border_color = $this->info['border-top-color'] = $this->info['border-bottom-color'] = @@ -1491,8 +1475,25 @@ protected function doSetup($config) $trusted_max_wh ); + // text-decoration and related shorthands $this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration(); + $this->info['text-decoration-line'] = new HTMLPurifier_AttrDef_Enum( + ['none', 'underline', 'overline', 'line-through', 'initial', 'inherit'] + ); + + $this->info['text-decoration-style'] = new HTMLPurifier_AttrDef_Enum( + ['solid', 'double', 'dotted', 'dashed', 'wavy', 'initial', 'inherit'] + ); + + $this->info['text-decoration-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + + $this->info['text-decoration-thickness'] = new HTMLPurifier_AttrDef_CSS_Composite([ + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage(), + new HTMLPurifier_AttrDef_Enum(['auto', 'from-font', 'initial', 'inherit']) + ]); + $this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily(); // this could use specialized code @@ -1762,7 +1763,7 @@ abstract class HTMLPurifier_ChildDef * Lookup array of all elements that this definition could possibly allow. * @type array */ - public $elements = []; + public $elements = array(); /** * Get lookup of tag names that should not close this element automatically. @@ -1811,7 +1812,7 @@ class HTMLPurifier_Config * HTML Purifier's version * @type string */ - public $version = '4.13.0'; + public $version = '4.17.0'; /** * Whether or not to automatically finalize @@ -1827,7 +1828,7 @@ class HTMLPurifier_Config * @see getSerial() for more info. * @type string[] */ - protected $serials = []; + protected $serials = array(); /** * Serial for entire configuration object. @@ -1895,7 +1896,7 @@ class HTMLPurifier_Config */ public function __construct($definition, $parent = null) { - $parent = $parent ?: $definition->defaultPlist; + $parent = $parent ? $parent : $definition->defaultPlist; $this->plist = new HTMLPurifier_PropertyList($parent); $this->def = $definition; // keep a copy around for checking $this->parser = new HTMLPurifier_VarParser_Flexible(); @@ -2068,7 +2069,7 @@ public function getAll() if (!$this->finalized) { $this->autoFinalize(); } - $ret = []; + $ret = array(); foreach ($this->plist->squash() as $name => $value) { list($ns, $key) = explode('.', $name, 2); $ret[$ns][$key] = $value; @@ -2179,7 +2180,7 @@ public function set($key, $value, $a = null) */ private function _listify($lookup) { - $list = []; + $list = array(); foreach ($lookup as $name => $b) { $list[] = $name; } @@ -2502,11 +2503,11 @@ public static function getAllowedDirectivesForForm($allowed, $schema = null) } if ($allowed !== true) { if (is_string($allowed)) { - $allowed = [$allowed]; + $allowed = array($allowed); } - $allowed_ns = []; - $allowed_directives = []; - $blacklisted_directives = []; + $allowed_ns = array(); + $allowed_directives = array(); + $blacklisted_directives = array(); foreach ($allowed as $ns_or_directive) { if (strpos($ns_or_directive, '.') !== false) { // directive @@ -2521,7 +2522,7 @@ public static function getAllowedDirectivesForForm($allowed, $schema = null) } } } - $ret = []; + $ret = array(); foreach ($schema->info as $key => $def) { list($ns, $directive) = explode('.', $key, 2); if ($allowed !== true) { @@ -2538,7 +2539,7 @@ public static function getAllowedDirectivesForForm($allowed, $schema = null) if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') { continue; } - $ret[] = [$ns, $directive]; + $ret[] = array($ns, $directive); } return $ret; } @@ -2591,12 +2592,12 @@ public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_ 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 = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); } - $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); + $mq = $mq_fix && version_compare(PHP_VERSION, '7.4.0', '<') && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); - $ret = []; + $ret = array(); foreach ($allowed as $key) { list($ns, $directive) = $key; $skey = "$ns.$directive"; @@ -2721,7 +2722,7 @@ class HTMLPurifier_ConfigSchema * @type array * @note This shares the exact same structure as HTMLPurifier_Config::$conf */ - public $defaults = []; + public $defaults = array(); /** * The default property list. Do not edit this property list. @@ -2760,7 +2761,7 @@ class HTMLPurifier_ConfigSchema * which uses more memory but has much richer information. * @type array */ - public $info = []; + public $info = array(); /** * Application-wide singleton @@ -2837,7 +2838,7 @@ public function add($key, $default, $type, $allow_null) public function addValueAliases($key, $aliases) { if (!isset($this->info[$key]->aliases)) { - $this->info[$key]->aliases = []; + $this->info[$key]->aliases = array(); } foreach ($aliases as $alias => $real) { $this->info[$key]->aliases[$alias] = $real; @@ -2898,25 +2899,25 @@ class HTMLPurifier_ContentSets * List of content set strings (pipe separators) indexed by name. * @type array */ - public $info = []; + public $info = array(); /** * List of content set lookups (element => true) indexed by name. * @type array * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets */ - public $lookup = []; + public $lookup = array(); /** * Synchronized list of defined content sets (keys of info). * @type array */ - protected $keys = []; + protected $keys = array(); /** * Synchronized list of defined content values (values of info). * @type array */ - protected $values = []; + protected $values = array(); /** * Merges in module's content sets, expands identifiers in the content @@ -2926,7 +2927,7 @@ class HTMLPurifier_ContentSets public function __construct($modules) { if (!is_array($modules)) { - $modules = [$modules]; + $modules = array($modules); } // populate content_sets based on module hints // sorry, no way of overloading @@ -2945,7 +2946,7 @@ public function __construct($modules) while ($old_lookup !== $this->lookup) { $old_lookup = $this->lookup; foreach ($this->lookup as $i => $set) { - $add = []; + $add = array(); foreach ($set as $element => $x) { if (isset($this->lookup[$element])) { $add += $this->lookup[$element]; @@ -2978,7 +2979,7 @@ public function generateChildDef(&$def, $module) // Assume that $this->keys is alphanumeric $def->content_model = preg_replace_callback( '/\b(' . implode('|', $this->keys) . ')\b/', - [$this, 'generateChildDefCallback'], + array($this, 'generateChildDefCallback'), $content_model ); //$def->content_model = str_replace( @@ -3047,7 +3048,7 @@ public function getChildDef($def, $module) protected function convertToLookup($string) { $array = explode('|', str_replace(' ', '', $string)); - $ret = []; + $ret = array(); foreach ($array as $k) { $ret[$k] = true; } @@ -3073,7 +3074,7 @@ class HTMLPurifier_Context * Private array that stores the references. * @type array */ - private $_storage = []; + private $_storage = array(); /** * Registers a variable into the context. @@ -3293,17 +3294,17 @@ class HTMLPurifier_DefinitionCacheFactory /** * @type array */ - protected $caches = ['Serializer' => []]; + protected $caches = array('Serializer' => array()); /** * @type array */ - protected $implementations = []; + protected $implementations = array(); /** * @type HTMLPurifier_DefinitionCache_Decorator[] */ - protected $decorators = []; + protected $decorators = array(); /** * Initialize default decorators @@ -3356,7 +3357,7 @@ public function create($type, $config) return $this->caches[$method][$type]; } if (isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false)) { + class_exists($class = $this->implementations[$method])) { $cache = new $class($type); } else { if ($method != 'Serializer') { @@ -3411,13 +3412,13 @@ class HTMLPurifier_Doctype * that this doctype uses * @type array */ - public $modules = []; + public $modules = array(); /** * List of modules to use for tidying up code * @type array */ - public $tidyModules = []; + public $tidyModules = array(); /** * Is the language derived from XML (i.e. XHTML)? @@ -3429,7 +3430,7 @@ class HTMLPurifier_Doctype * List of aliases for this doctype * @type array */ - public $aliases = []; + public $aliases = array(); /** * Public DTD identifier @@ -3446,9 +3447,9 @@ class HTMLPurifier_Doctype public function __construct( $name = null, $xml = true, - $modules = [], - $tidyModules = [], - $aliases = [], + $modules = array(), + $tidyModules = array(), + $aliases = array(), $dtd_public = null, $dtd_system = null ) { @@ -3497,20 +3498,20 @@ class HTMLPurifier_DoctypeRegistry public function register( $doctype, $xml = true, - $modules = [], - $tidy_modules = [], - $aliases = [], + $modules = array(), + $tidy_modules = array(), + $aliases = array(), $dtd_public = null, $dtd_system = null ) { if (!is_array($modules)) { - $modules = [$modules]; + $modules = array($modules); } if (!is_array($tidy_modules)) { - $tidy_modules = [$tidy_modules]; + $tidy_modules = array($tidy_modules); } if (!is_array($aliases)) { - $aliases = [$aliases]; + $aliases = array($aliases); } if (!is_object($doctype)) { $doctype = new HTMLPurifier_Doctype( @@ -3638,7 +3639,7 @@ class HTMLPurifier_ElementDef * see HTMLPurifier_AttrTypes on how they are expanded during * HTMLPurifier_HTMLDefinition->setup() processing. */ - public $attr = []; + public $attr = array(); // XXX: Design note: currently, it's not possible to override // previously defined AttrTransforms without messing around with @@ -3656,13 +3657,13 @@ class HTMLPurifier_ElementDef * List of tags HTMLPurifier_AttrTransform to be done before validation. * @type array */ - public $attr_transform_pre = []; + public $attr_transform_pre = array(); /** * List of tags HTMLPurifier_AttrTransform to be done after validation. * @type array */ - public $attr_transform_post = []; + public $attr_transform_post = array(); /** * HTMLPurifier_ChildDef of this tag. @@ -3704,7 +3705,7 @@ class HTMLPurifier_ElementDef * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() * @type array */ - public $required_attr = []; + public $required_attr = array(); /** * Lookup table of tags excluded from all descendants of this tag. @@ -3718,13 +3719,13 @@ class HTMLPurifier_ElementDef * Modularization Abstract Modules are blithely unaware of such * distinctions. */ - public $excludes = []; + public $excludes = array(); /** * This tag is explicitly auto-closed by the following tags. * @type array */ - public $autoclose = []; + public $autoclose = array(); /** * If a foreign element is found in this element, test if it is @@ -3785,7 +3786,7 @@ public function mergeIn($def) if (!empty($def->content_model)) { $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); + str_replace("#SUPER", (string)$this->content_model, $def->content_model); $this->child = false; } if (!empty($def->content_model_type)) { @@ -3857,7 +3858,7 @@ public static function muteErrorHandler() */ public static function unsafeIconv($in, $out, $text) { - set_error_handler(['HTMLPurifier_Encoder', 'muteErrorHandler']); + set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); $r = iconv($in, $out, $text); restore_error_handler(); return $r; @@ -4224,8 +4225,8 @@ public static function convertToUTF8($str, $config, $context) // characters to their true byte-wise ASCII/UTF-8 equivalents. $str = strtr($str, self::testEncodingSupportsASCII($encoding)); return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); + } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) { + $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1'); return $str; } $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); @@ -4266,7 +4267,7 @@ public static function convertFromUTF8($str, $config, $context) // Undo our previous fix in convertToUTF8, otherwise iconv will barf $ascii_fix = self::testEncodingSupportsASCII($encoding); if (!$escape && !empty($ascii_fix)) { - $clear_fix = []; + $clear_fix = array(); foreach ($ascii_fix as $utf8 => $native) { $clear_fix[$utf8] = ''; } @@ -4276,8 +4277,8 @@ public static function convertFromUTF8($str, $config, $context) // Normal stuff $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); + } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) { + $str = mb_convert_encoding($str, 'ISO-8859-1', 'UTF-8'); return $str; } trigger_error('Encoding not supported', E_USER_ERROR); @@ -4401,7 +4402,7 @@ public static function testEncodingSupportsASCII($encoding, $bypass = false) // If ICONV_TRUNCATE, all calls involve one character inputs, // so bug is not triggered. // If ICONV_UNUSABLE, this call is irrelevant - static $encodings = []; + static $encodings = array(); if (!$bypass) { if (isset($encodings[$encoding])) { return $encodings[$encoding]; @@ -4409,15 +4410,15 @@ public static function testEncodingSupportsASCII($encoding, $bypass = false) $lenc = strtolower($encoding); switch ($lenc) { case 'shift_jis': - return ["\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~']; + return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); case 'johab': - return ["\xE2\x82\xA9" => '\\']; + return array("\xE2\x82\xA9" => '\\'); } if (strpos($lenc, 'iso-8859-') === 0) { - return []; + return array(); } } - $ret = []; + $ret = array(); if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { return false; } @@ -4576,7 +4577,7 @@ public function substituteTextEntities($string) { return preg_replace_callback( $this->_textEntitiesRegex, - [$this, 'entityCallback'], + array($this, 'entityCallback'), $string ); } @@ -4592,7 +4593,7 @@ public function substituteAttrEntities($string) { return preg_replace_callback( $this->_attrEntitiesRegex, - [$this, 'entityCallback'], + array($this, 'entityCallback'), $string ); } @@ -4630,7 +4631,7 @@ protected function entityCallback($matches) if (!empty($matches[3])) { return preg_replace_callback( $this->_semiOptionalPrefixRegex, - [$this, 'entityCallback'], + array($this, 'entityCallback'), $entity ); } @@ -4654,25 +4655,25 @@ protected function entityCallback($matches) * @type array */ protected $_special_dec2str = - [ + array( 34 => '"', 38 => '&', 39 => "'", 60 => '<', 62 => '>' - ]; + ); /** * Stripped entity names to decimal conversion table for special entities. * @type array */ protected $_special_ent2dec = - [ + array( 'quot' => 34, 'amp' => 38, 'lt' => 60, 'gt' => 62 - ]; + ); /** * Substitutes non-special entities with their parsed equivalents. Since @@ -4687,7 +4688,7 @@ public function substituteNonSpecialEntities($string) // it will try to detect missing semicolons, but don't rely on it return preg_replace_callback( $this->_substituteEntitiesRegex, - [$this, 'nonSpecialEntityCallback'], + array($this, 'nonSpecialEntityCallback'), $string ); } @@ -4742,7 +4743,7 @@ public function substituteSpecialEntities($string) { return preg_replace_callback( $this->_substituteEntitiesRegex, - [$this, 'specialEntityCallback'], + array($this, 'specialEntityCallback'), $string ); } @@ -4808,7 +4809,7 @@ class HTMLPurifier_ErrorCollector /** * @type array */ - protected $_stacks = [[]]; + protected $_stacks = array(array()); /** * @type HTMLPurifier_Language @@ -4828,7 +4829,7 @@ class HTMLPurifier_ErrorCollector /** * @type array */ - protected $lines = []; + protected $lines = array(); /** * @param HTMLPurifier_Context $context @@ -4848,7 +4849,7 @@ public function __construct($context) */ public function send($severity, $msg) { - $args = []; + $args = array(); if (func_num_args() > 2) { $args = func_get_args(); array_shift($args); @@ -4861,7 +4862,7 @@ public function send($severity, $msg) $attr = $this->context->get('CurrentAttr', true); // perform special substitutions, also add custom parameters - $subst = []; + $subst = array(); if (!is_null($token)) { $args['CurrentToken'] = $token; } @@ -4883,12 +4884,12 @@ public function send($severity, $msg) } // (numerically indexed) - $error = [ + $error = array( self::LINENO => $line, self::SEVERITY => $severity, self::MESSAGE => $msg, - self::CHILDREN => [] - ]; + self::CHILDREN => array() + ); $this->_current[] = $error; // NEW CODE BELOW ... @@ -4921,14 +4922,14 @@ public function send($severity, $msg) if (!empty($attr)) { $struct = $struct->getChild(HTMLPurifier_ErrorStruct::ATTR, $attr); if (!$struct->value) { - $struct->value = [$attr, 'PUT VALUE HERE']; + $struct->value = array($attr, 'PUT VALUE HERE'); } } if (!empty($cssprop)) { $struct = $struct->getChild(HTMLPurifier_ErrorStruct::CSSPROP, $cssprop); if (!$struct->value) { // if we tokenize CSS this might be a little more difficult to do - $struct->value = [$cssprop, 'PUT VALUE HERE']; + $struct->value = array($cssprop, 'PUT VALUE HERE'); } } @@ -4952,7 +4953,7 @@ public function getRaw() */ public function getHTMLFormatted($config, $errors = null) { - $ret = []; + $ret = array(); $this->generator = new HTMLPurifier_Generator($config, $this->context); if ($errors === null) { @@ -4984,8 +4985,8 @@ public function getHTMLFormatted($config, $errors = null) private function _renderStruct(&$ret, $struct, $line = null, $col = null) { - $stack = [$struct]; - $context_stack = [[]]; + $stack = array($struct); + $context_stack = array(array()); while ($current = array_pop($stack)) { $context = array_pop($context_stack); foreach ($current->errors as $error) { @@ -5061,7 +5062,7 @@ class HTMLPurifier_ErrorStruct * Errors registered for this structure. * @type array */ - public $errors = []; + public $errors = array(); /** * Child ErrorStructs that are from this structure. For example, a TOKEN @@ -5069,7 +5070,7 @@ class HTMLPurifier_ErrorStruct * array in structure: [TYPE]['identifier'] * @type array */ - public $children = []; + public $children = array(); /** * @param string $type @@ -5091,7 +5092,7 @@ public function getChild($type, $id) */ public function addError($severity, $message) { - $this->errors[] = [$severity, $message]; + $this->errors[] = array($severity, $message); } } @@ -5221,7 +5222,7 @@ class HTMLPurifier_Generator * compatibility code. * @type array */ - private $_flashStack = []; + private $_flashStack = array(); /** * Configuration for the generator @@ -5274,13 +5275,13 @@ public function generateFromTokens($tokens) $tidy = new Tidy; $tidy->parseString( $html, - [ + array( 'indent'=> true, 'output-xhtml' => $this->_xhtml, 'show-body-only' => true, 'indent-spaces' => 2, 'wrap' => 68, - ], + ), 'utf8' ); $tidy->cleanRepair(); @@ -5317,7 +5318,7 @@ public function generateFromToken($token) if ($token->name == "object") { $flash = new stdClass(); $flash->attr = $token->attr; - $flash->param = []; + $flash->param = array(); $this->_flashStack[] = $flash; } } @@ -5488,13 +5489,13 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition * Associative array of element names to HTMLPurifier_ElementDef. * @type HTMLPurifier_ElementDef[] */ - public $info = []; + public $info = array(); /** * Associative array of global attribute name to attribute definition. * @type array */ - public $info_global_attr = []; + public $info_global_attr = array(); /** * String name of parent element HTML will be going into. @@ -5520,32 +5521,32 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition * Associative array of deprecated tag name to HTMLPurifier_TagTransform. * @type array */ - public $info_tag_transform = []; + public $info_tag_transform = array(); /** * Indexed list of HTMLPurifier_AttrTransform to be performed before validation. * @type HTMLPurifier_AttrTransform[] */ - public $info_attr_transform_pre = []; + public $info_attr_transform_pre = array(); /** * Indexed list of HTMLPurifier_AttrTransform to be performed after validation. * @type HTMLPurifier_AttrTransform[] */ - public $info_attr_transform_post = []; + public $info_attr_transform_post = array(); /** * Nested lookup array of content set name (Block, Inline) to * element name to whether or not it belongs in that content set. * @type array */ - public $info_content_sets = []; + public $info_content_sets = array(); /** * Indexed list of HTMLPurifier_Injector to be used. * @type HTMLPurifier_Injector[] */ - public $info_injector = []; + public $info_injector = array(); /** * Doctype object @@ -5582,7 +5583,7 @@ public function addAttribute($element_name, $attr_name, $def) * @see HTMLPurifier_HTMLModule::addElement() for detailed * parameter and return value descriptions. */ - public function addElement($element_name, $type, $contents, $attr_collections, $attributes = []) + public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) { $module = $this->getAnonymousModule(); // assume that if the user is calling this, the element @@ -5776,7 +5777,7 @@ protected function setupConfigStuff($config) // global attributes. It's possible that userland code uses // it, but HTMLModuleManager doesn't! foreach ($this->info_global_attr as $attr => $x) { - $keys = [$attr, "*@$attr", "*.$attr"]; + $keys = array($attr, "*@$attr", "*.$attr"); $delete = true; foreach ($keys as $key) { if ($delete && isset($allowed_attributes[$key])) { @@ -5793,7 +5794,7 @@ protected function setupConfigStuff($config) foreach ($this->info as $tag => $info) { foreach ($info->attr as $attr => $x) { - $keys = ["$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"]; + $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); $delete = true; foreach ($keys as $key) { if ($delete && isset($allowed_attributes[$key])) { @@ -5913,10 +5914,10 @@ protected function setupConfigStuff($config) */ public function parseTinyMCEAllowedList($list) { - $list = str_replace([' ', "\t"], '', $list); + $list = str_replace(array(' ', "\t"), '', $list); - $elements = []; - $attributes = []; + $elements = array(); + $attributes = array(); $chunks = preg_split('/(,|[\n\r]+)/', $list); foreach ($chunks as $chunk) { @@ -5942,7 +5943,7 @@ public function parseTinyMCEAllowedList($list) $attributes["$element.$key"] = true; } } - return [$elements, $attributes]; + return array($elements, $attributes); } } @@ -5981,7 +5982,7 @@ class HTMLPurifier_HTMLModule * Not used in any significant way. * @type array */ - public $elements = []; + public $elements = array(); /** * Associative array of element names to element definitions. @@ -5989,7 +5990,7 @@ class HTMLPurifier_HTMLModule * with the full definition. * @type array */ - public $info = []; + public $info = array(); /** * Associative array of content set names to content set additions. @@ -5998,7 +5999,7 @@ class HTMLPurifier_HTMLModule * and NOT info_content_sets member variable of HTMLDefinition. * @type array */ - public $content_sets = []; + public $content_sets = array(); /** * Associative array of attribute collection names to attribute @@ -6009,25 +6010,25 @@ class HTMLPurifier_HTMLModule * with extra behavior associated with it. * @type array */ - public $attr_collections = []; + public $attr_collections = array(); /** * Associative array of deprecated tag name to HTMLPurifier_TagTransform. * @type array */ - public $info_tag_transform = []; + public $info_tag_transform = array(); /** * List of HTMLPurifier_AttrTransform to be performed before validation. * @type array */ - public $info_attr_transform_pre = []; + public $info_attr_transform_pre = array(); /** * List of HTMLPurifier_AttrTransform to be performed after validation. * @type array */ - public $info_attr_transform_post = []; + public $info_attr_transform_post = array(); /** * List of HTMLPurifier_Injector to be performed during well-formedness fixing. @@ -6036,7 +6037,7 @@ class HTMLPurifier_HTMLModule * silently disabled. * @type array */ - public $info_injector = []; + public $info_injector = array(); /** * Boolean flag that indicates whether or not getChildDef is implemented. @@ -6091,7 +6092,7 @@ public function getChildDef($def) * @return HTMLPurifier_ElementDef Created element definition object, so you * can set advanced parameters */ - public function addElement($element, $type, $contents, $attr_includes = [], $attr = []) + public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) { $this->elements[] = $element; // parse content_model @@ -6162,21 +6163,21 @@ public function addElementToContentSet($element, $type) public function parseContents($contents) { if (!is_string($contents)) { - return [null, null]; + return array(null, null); } // defer switch ($contents) { // check for shorthand content model forms case 'Empty': - return ['empty', '']; + return array('empty', ''); case 'Inline': - return ['optional', 'Inline | #PCDATA']; + return array('optional', 'Inline | #PCDATA'); case 'Flow': - return ['optional', 'Flow | #PCDATA']; + return array('optional', 'Flow | #PCDATA'); } list($content_model_type, $content_model) = explode(':', $contents); $content_model_type = strtolower(trim($content_model_type)); $content_model = trim($content_model); - return [$content_model_type, $content_model]; + return array($content_model_type, $content_model); } /** @@ -6189,9 +6190,9 @@ public function mergeInAttrIncludes(&$attr, $attr_includes) { if (!is_array($attr_includes)) { if (empty($attr_includes)) { - $attr_includes = []; + $attr_includes = array(); } else { - $attr_includes = [$attr_includes]; + $attr_includes = array($attr_includes); } } $attr[0] = $attr_includes; @@ -6207,10 +6208,11 @@ public function mergeInAttrIncludes(&$attr, $attr_includes) */ public function makeLookup($list) { + $args = func_get_args(); if (is_string($list)) { - $list = func_get_args(); + $list = $args; } - $ret = []; + $ret = array(); foreach ($list as $value) { if (is_null($value)) { continue; @@ -6259,7 +6261,7 @@ class HTMLPurifier_HTMLModuleManager * indexed, by name, in this array. * @type HTMLPurifier_HTMLModule[] */ - public $modules = []; + public $modules = array(); /** * Array of recognized HTMLPurifier_HTMLModule instances, @@ -6267,7 +6269,7 @@ class HTMLPurifier_HTMLModuleManager * user can overload a module by pre-emptively registering it. * @type HTMLPurifier_HTMLModule[] */ - public $registeredModules = []; + public $registeredModules = array(); /** * List of extra modules that were added by the user @@ -6275,20 +6277,20 @@ class HTMLPurifier_HTMLModuleManager * it may be. * @type HTMLPurifier_HTMLModule[] */ - public $userModules = []; + public $userModules = array(); /** * Associative array of element name to list of modules that have * definitions for the element; this array is dynamically filled. * @type array */ - public $elementLookup = []; + public $elementLookup = array(); /** * List of prefixes we should use for registering small names. * @type array */ - public $prefixes = ['HTMLPurifier_HTMLModule_']; + public $prefixes = array('HTMLPurifier_HTMLModule_'); /** * @type HTMLPurifier_ContentSets @@ -6313,7 +6315,7 @@ public function __construct() $this->doctypes = new HTMLPurifier_DoctypeRegistry(); // setup basic modules - $common = [ + $common = array( 'CommonAttributes', 'Text', 'Hypertext', 'List', 'Presentation', 'Edit', 'Bdo', 'Tables', 'Image', 'StyleAttribute', @@ -6321,18 +6323,18 @@ public function __construct() 'Scripting', 'Object', 'Forms', // Sorta legacy, but present in strict: 'Name', - ]; - $transitional = ['Legacy', 'Target', 'Iframe']; - $xml = ['XMLCommonAttributes']; - $non_xml = ['NonXMLCommonAttributes']; + ); + $transitional = array('Legacy', 'Target', 'Iframe'); + $xml = array('XMLCommonAttributes'); + $non_xml = array('NonXMLCommonAttributes'); // setup basic doctypes $this->doctypes->register( 'HTML 4.01 Transitional', false, array_merge($common, $transitional, $non_xml), - ['Tidy_Transitional', 'Tidy_Proprietary'], - [], + array('Tidy_Transitional', 'Tidy_Proprietary'), + array(), '-//W3C//DTD HTML 4.01 Transitional//EN', 'http://www.w3.org/TR/html4/loose.dtd' ); @@ -6341,8 +6343,8 @@ public function __construct() 'HTML 4.01 Strict', false, array_merge($common, $non_xml), - ['Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'], - [], + array('Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), + array(), '-//W3C//DTD HTML 4.01//EN', 'http://www.w3.org/TR/html4/strict.dtd' ); @@ -6351,8 +6353,8 @@ public function __construct() 'XHTML 1.0 Transitional', true, array_merge($common, $transitional, $xml, $non_xml), - ['Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Name'], - [], + array('Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Name'), + array(), '-//W3C//DTD XHTML 1.0 Transitional//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' ); @@ -6361,8 +6363,8 @@ public function __construct() 'XHTML 1.0 Strict', true, array_merge($common, $xml, $non_xml), - ['Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'], - [], + array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), + array(), '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' ); @@ -6372,9 +6374,9 @@ public function __construct() true, // Iframe is a real XHTML 1.1 module, despite being // "transitional"! - array_merge($common, $xml, ['Ruby', 'Iframe']), - ['Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict', 'Tidy_Name'], // Tidy_XHTML1_1 - [], + array_merge($common, $xml, array('Ruby', 'Iframe')), + array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict', 'Tidy_Name'), // Tidy_XHTML1_1 + array(), '-//W3C//DTD XHTML 1.1//EN', 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' ); @@ -6497,7 +6499,7 @@ public function setup($config) if ($config->get('HTML.SafeEmbed')) { $modules[] = 'SafeEmbed'; } - if ($config->get('HTML.SafeScripting') !== []) { + if ($config->get('HTML.SafeScripting') !== array()) { $modules[] = 'SafeScripting'; } if ($config->get('HTML.Nofollow')) { @@ -6530,7 +6532,7 @@ public function setup($config) // prepare any injectors foreach ($this->modules as $module) { - $n = []; + $n = array(); foreach ($module->info_injector as $injector) { if (!is_object($injector)) { $class = "HTMLPurifier_Injector_$injector"; @@ -6545,7 +6547,7 @@ public function setup($config) foreach ($this->modules as $module) { foreach ($module->info as $name => $def) { if (!isset($this->elementLookup[$name])) { - $this->elementLookup[$name] = []; + $this->elementLookup[$name] = array(); } $this->elementLookup[$name][] = $module->name; } @@ -6584,7 +6586,7 @@ public function processModule($module) */ public function getElements() { - $elements = []; + $elements = array(); foreach ($this->modules as $module) { if (!$this->trusted && !$module->safe) { continue; @@ -6716,7 +6718,7 @@ class HTMLPurifier_IDAccumulator * Lookup table of IDs we've accumulated. * @public */ - public $ids = []; + public $ids = array(); /** * Builds an IDAccumulator, also initializing the default blacklist @@ -6813,7 +6815,7 @@ abstract class HTMLPurifier_Injector * array('element' => array('attr', 'attr2'), 'element2') * @type array */ - public $needed = []; + public $needed = array(); /** * Number of elements to rewind backwards (relative). @@ -7068,13 +7070,13 @@ class HTMLPurifier_Language * Array of localizable messages. * @type array */ - public $messages = []; + public $messages = array(); /** * Array of localizable error codes. * @type array */ - public $errorNames = []; + public $errorNames = array(); /** * True if no message file was found for this language, so English @@ -7190,7 +7192,7 @@ public function listify($array) * @todo Implement conditionals? Right now, some messages make * reference to line numbers, but those aren't always available */ - public function formatMessage($key, $args = []) + public function formatMessage($key, $args = array()) { if (!$this->_loaded) { $this->load(); @@ -7199,7 +7201,7 @@ public function formatMessage($key, $args = []) return "[$key]"; } $raw = $this->messages[$key]; - $subst = []; + $subst = array(); $generator = false; foreach ($args as $i => $value) { if (is_object($value)) { @@ -7221,10 +7223,10 @@ public function formatMessage($key, $args = []) // may need to be factored out into a dedicated class if (!empty($value->attr)) { $stripped_token = clone $value; - $stripped_token->attr = []; + $stripped_token->attr = array(); $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); } - $subst['$'.$i.'.Line'] = $value->line ?: 'unknown'; + $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; } continue; } elseif (is_array($value)) { @@ -7272,7 +7274,7 @@ class HTMLPurifier_LanguageFactory * variables to slurp out of a message file. * @type array */ - public $keys = ['fallback', 'messages', 'errorNames']; + public $keys = array('fallback', 'messages', 'errorNames'); /** * Instance to validate language codes. @@ -7292,13 +7294,13 @@ class HTMLPurifier_LanguageFactory * Keys whose contents are a hash map and can be merged. * @type array */ - protected $mergeable_keys_map = ['messages' => true, 'errorNames' => true]; + protected $mergeable_keys_map = array('messages' => true, 'errorNames' => true); /** * Keys whose contents are a list and can be merged. * @value array lookup */ - protected $mergeable_keys_list = []; + protected $mergeable_keys_list = array(); /** * Retrieve sole instance of the factory. @@ -7359,12 +7361,12 @@ public function create($config, $context, $code = false) } else { $class = 'HTMLPurifier_Language_' . $pcode; $file = $this->dir . '/Language/classes/' . $code . '.php'; - if (file_exists($file) || class_exists($class, false)) { + if (file_exists($file) || class_exists($class)) { $lang = new $class($config, $context); } else { // Go fallback $raw_fallback = $this->getFallbackFor($code); - $fallback = $raw_fallback ?: 'en'; + $fallback = $raw_fallback ? $raw_fallback : 'en'; $depth++; $lang = $this->create($config, $context, $fallback); if (!$raw_fallback) { @@ -7395,7 +7397,7 @@ public function getFallbackFor($code) */ public function loadLanguage($code) { - static $languages_seen = []; // recursion guard + static $languages_seen = array(); // recursion guard // abort if we've already loaded it if (isset($this->cache[$code])) { @@ -7412,7 +7414,7 @@ public function loadLanguage($code) if (!file_exists($filename)) { // skip the include: will rely solely on fallback $filename = $this->dir . '/Language/messages/en.php'; - $cache = []; + $cache = array(); } else { include $filename; $cache = compact($this->keys); @@ -7489,12 +7491,12 @@ class HTMLPurifier_Length * Array Lookup array of units recognized by CSS 3 * @type array */ - protected static $allowedUnits = [ + protected static $allowedUnits = array( 'em' => true, 'ex' => true, 'px' => true, 'in' => true, 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true, 'ch' => true, 'rem' => true, 'vw' => true, 'vh' => true, 'vmin' => true, 'vmax' => true - ]; + ); /** * @param string $n Magnitude @@ -7538,7 +7540,7 @@ protected function validate() if ($this->n === '0' && $this->unit === false) { return true; } - if (!ctype_lower($this->unit)) { + if ($this->unit === false || !ctype_lower($this->unit)) { $this->unit = strtolower($this->unit); } if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) { @@ -7671,6 +7673,11 @@ class HTMLPurifier_Lexer */ public $tracksLineNumbers = false; + /** + * @type HTMLPurifier_EntityParser + */ + private $_entity_parser; + // -- STATIC ---------------------------------------------------------- /** @@ -7719,7 +7726,7 @@ public static function create($config) break; } - if (class_exists('DOMDocument', false) && + if (class_exists('DOMDocument') && method_exists('DOMDocument', 'loadHTML') && !extension_loaded('domxml') ) { @@ -7782,7 +7789,7 @@ public function __construct() * @type array */ protected $_special_entity2str = - [ + array( '"' => '"', '&' => '&', '<' => '<', @@ -7790,7 +7797,7 @@ public function __construct() ''' => "'", ''' => "'", ''' => "'" - ]; + ); public function parseText($string, $config) { return $this->parseData($string, false, $config); @@ -7868,7 +7875,7 @@ protected static function escapeCDATA($string) { return preg_replace_callback( '//s', - ['HTMLPurifier_Lexer', 'CDATACallback'], + array('HTMLPurifier_Lexer', 'CDATACallback'), $string ); } @@ -7882,21 +7889,7 @@ protected static function escapeCommentedCDATA($string) { return preg_replace_callback( '##s', - ['HTMLPurifier_Lexer', 'CDATACallback'], - $string - ); - } - - /** - * Special Internet Explorer conditional comments should be removed. - * @param string $string HTML string to process. - * @return string HTML with conditional comments removed. - */ - protected static function removeIEConditional($string) - { - return preg_replace( - '##si', // probably should generalize for all strings - '', + array('HTMLPurifier_Lexer', 'CDATACallback'), $string ); } @@ -7929,8 +7922,8 @@ public function normalize($html, $config, $context) { // normalize newlines to \n if ($config->get('Core.NormalizeNewlines')) { - $html = str_replace("\r\n", "\n", $html); - $html = str_replace("\r", "\n", $html); + $html = str_replace("\r\n", "\n", (string)$html); + $html = str_replace("\r", "\n", (string)$html); } if ($config->get('HTML.Trusted')) { @@ -7941,8 +7934,6 @@ public function normalize($html, $config, $context) // escape CDATA $html = $this->escapeCDATA($html); - $html = $this->removeIEConditional($html); - // extract body from document if applicable if ($config->get('Core.ConvertDocumentToFragment')) { $e = false; @@ -7987,7 +7978,7 @@ public function normalize($html, $config, $context) */ public function extractBody($html) { - $matches = []; + $matches = array(); $result = preg_match('|(.*?)]*>(.*)|is', $html, $matches); if ($result) { // Make sure it's not in a comment @@ -8033,7 +8024,7 @@ abstract class HTMLPurifier_Node * Currently, valid values are "ValidateAttributes". * @type array */ - public $armor = []; + public $armor = array(); /** * When true, this node should be ignored as non-existent. @@ -8071,7 +8062,7 @@ class HTMLPurifier_PercentEncoder * Reserved characters to preserve when using encode(). * @type array */ - protected $preserve = []; + protected $preserve = array(); /** * String of characters that should be preserved while using encode(). @@ -8177,7 +8168,7 @@ class HTMLPurifier_PropertyList * Internal data-structure for properties. * @type array */ - protected $data = []; + protected $data = array(); /** * Parent plist. @@ -8244,7 +8235,7 @@ public function has($name) public function reset($name = null) { if ($name == null) { - $this->data = []; + $this->data = array(); } else { unset($this->data[$name]); } @@ -8320,6 +8311,7 @@ public function __construct(Iterator $iterator, $filter = null) /** * @return bool */ + #[\ReturnTypeWillChange] public function accept() { $key = $this->getInnerIterator()->key(); @@ -8355,9 +8347,9 @@ class HTMLPurifier_Queue { private $input; private $output; - public function __construct($input = []) { + public function __construct($input = array()) { $this->input = $input; - $this->output = []; + $this->output = array(); } /** @@ -8366,7 +8358,7 @@ public function __construct($input = []) { public function shift() { if (empty($this->output)) { $this->output = array_reverse($this->input); - $this->input = []; + $this->input = array(); } if (empty($this->output)) { return NULL; @@ -8431,13 +8423,14 @@ class HTMLPurifier_StringHash extends ArrayObject /** * @type array */ - protected $accessed = []; + protected $accessed = array(); /** * Retrieves a value, and logs the access. * @param mixed $index * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($index) { $this->accessed[$index] = true; @@ -8458,7 +8451,7 @@ public function getAccessed() */ public function resetAccessed() { - $this->accessed = []; + $this->accessed = array(); } } @@ -8528,7 +8521,7 @@ public function parseMultiFile($file) if (!file_exists($file)) { return false; } - $ret = []; + $ret = array(); $fh = fopen($file, 'r'); if (!$fh) { return false; @@ -8553,7 +8546,7 @@ protected function parseHandle($fh) { $state = false; $single = false; - $ret = []; + $ret = array(); do { $line = fgets($fh); if ($line === false) { @@ -8664,7 +8657,7 @@ abstract class HTMLPurifier_Token * "MakeWellFormed_TagClosedError" * @type array */ - public $armor = []; + public $armor = array(); /** * Used during MakeWellFormed. See Note [Injector skips] @@ -8787,9 +8780,9 @@ class HTMLPurifier_TokenFactory */ public function __construct() { - $this->p_start = new HTMLPurifier_Token_Start('', []); + $this->p_start = new HTMLPurifier_Token_Start('', array()); $this->p_end = new HTMLPurifier_Token_End(''); - $this->p_empty = new HTMLPurifier_Token_Empty('', []); + $this->p_empty = new HTMLPurifier_Token_Empty('', array()); $this->p_text = new HTMLPurifier_Token_Text(''); $this->p_comment = new HTMLPurifier_Token_Comment(''); } @@ -8800,7 +8793,7 @@ public function __construct() * @param array $attr Associative array of attributes * @return HTMLPurifier_Token_Start Generated HTMLPurifier_Token_Start */ - public function createStart($name, $attr = []) + public function createStart($name, $attr = array()) { $p = clone $this->p_start; $p->__construct($name, $attr); @@ -8825,7 +8818,7 @@ public function createEnd($name) * @param array $attr Associative array of attributes * @return HTMLPurifier_Token_Empty Generated HTMLPurifier_Token_Empty */ - public function createEmpty($name, $attr = []) + public function createEmpty($name, $attr = array()) { $p = clone $this->p_empty; $p->__construct($name, $attr); @@ -9182,9 +9175,9 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition { public $type = 'URI'; - protected $filters = []; - protected $postFilters = []; - protected $registeredFilters = []; + protected $filters = array(); + protected $postFilters = array(); + protected $registeredFilters = array(); /** * HTMLPurifier_URI object of the base specified at %URI.Base @@ -9404,7 +9397,7 @@ public function parse($uri) '(#([^"<>]*))?'. // 8. Fragment '!'; - $matches = []; + $matches = array(); $result = preg_match($r_URI, $uri, $matches); if (!$result) return false; // *really* invalid URI @@ -9419,7 +9412,7 @@ public function parse($uri) // further parse authority if ($authority !== null) { $r_authority = "/^((.+?)@)?(\[[^\]]+\]|[^:]*)(:(\d*))?/"; - $matches = []; + $matches = array(); preg_match($r_authority, $authority, $matches); $userinfo = !empty($matches[1]) ? $matches[2] : null; $host = !empty($matches[3]) ? $matches[3] : ''; @@ -9570,7 +9563,7 @@ public static function instance($prototype = null) * Cache of retrieved schemes. * @type HTMLPurifier_URIScheme[] */ - protected $schemes = []; + protected $schemes = array(); /** * Retrieves a scheme validator object @@ -9643,20 +9636,20 @@ class HTMLPurifier_UnitConverter * constraint on memory (this is generally not a problem, since * the number of measuring systems is small.) */ - protected static $units = [ - self::ENGLISH => [ + protected static $units = array( + self::ENGLISH => array( 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary 'pt' => 4, 'pc' => 48, 'in' => 288, - self::METRIC => ['pt', '0.352777778', 'mm'], - ], - self::METRIC => [ + self::METRIC => array('pt', '0.352777778', 'mm'), + ), + self::METRIC => array( 'mm' => 1, 'cm' => 10, - self::ENGLISH => ['mm', '2.83464567', 'pt'], - ], - ]; + self::ENGLISH => array('mm', '2.83464567', 'pt'), + ), + ); /** * Minimum bcmath precision for output. @@ -9884,7 +9877,7 @@ private function div($s1, $s2, $scale) */ private function round($n, $sigfigs) { - $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1 + $new_log = (int)floor(log(abs((float)$n), 10)); // Number of digits left of decimal - 1 $rp = $sigfigs - $new_log - 1; // Number of decimal places needed $neg = $n < 0 ? '-' : ''; // Negative sign if ($this->bcmath) { @@ -9899,7 +9892,7 @@ private function round($n, $sigfigs) } return $n; } else { - return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1); + return $this->scale(round((float)$n, $sigfigs - $new_log - 1), $rp + 1); } } @@ -9923,7 +9916,7 @@ private function scale($r, $scale) // Now we return it, truncating the zero that was rounded off. return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); } - return sprintf('%.' . $scale . 'f', (float)$r); + return number_format((float)$r, $scale, '.', ''); } } @@ -9954,7 +9947,7 @@ class HTMLPurifier_VarParser * Lookup table of allowed types. Mainly for backwards compatibility, but * also convenient for transforming string type names to the integer constants. */ - public static $types = [ + public static $types = array( 'string' => self::C_STRING, 'istring' => self::ISTRING, 'text' => self::TEXT, @@ -9966,18 +9959,18 @@ class HTMLPurifier_VarParser 'list' => self::ALIST, 'hash' => self::HASH, 'mixed' => self::C_MIXED - ]; + ); /** * Lookup table of types that are string, and can have aliases or * allowed value lists. */ - public static $stringTypes = [ + public static $stringTypes = array( self::C_STRING => true, self::ISTRING => true, self::TEXT => true, self::ITEXT => true, - ]; + ); /** * Validate a variable according to type. @@ -10176,9 +10169,9 @@ public function __construct($front, $back) { * @return Tuple of zipper and element of first position. */ static public function fromArray($array) { - $z = new self([], array_reverse($array)); + $z = new self(array(), array_reverse($array)); $t = $z->delete(); // delete the "dummy hole" - return [$z, $t]; + return array($z, $t); } /** @@ -10283,7 +10276,7 @@ public function insertAfter($t) { */ public function splice($t, $delete, $replacement) { // delete - $old = []; + $old = array(); $r = $t; for ($i = $delete; $i > 0; $i--) { $old[] = $r; @@ -10294,7 +10287,7 @@ public function splice($t, $delete, $replacement) { $this->insertAfter($r); $r = $replacement[$i]; } - return [$old, $r]; + return array($old, $r); } } @@ -10334,7 +10327,7 @@ public function validate($css, $config, $context) // handle quotes. $len = strlen($css); $accum = ""; - $declarations = []; + $declarations = array(); $quoted = false; for ($i = 0; $i < $len; $i++) { $c = strcspn($css, ";'\"", $i); @@ -10359,7 +10352,7 @@ public function validate($css, $config, $context) } if ($accum != "") $declarations[] = $accum; - $propvalues = []; + $propvalues = array(); $new_declarations = ''; /** @@ -10427,7 +10420,7 @@ public function validate($css, $config, $context) $new_declarations .= "$prop:$value;"; } - return $new_declarations ?: false; + return $new_declarations ? $new_declarations : false; } @@ -10497,7 +10490,7 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef * @type array * @todo Make protected */ - public $valid_values = []; + public $valid_values = array(); /** * Bool indicating whether or not enumeration is case sensitive. @@ -10509,7 +10502,7 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef * @param array $valid_values List of valid values * @param bool $case_sensitive Whether or not case sensitive */ - public function __construct($valid_values = [], $case_sensitive = false) + public function __construct($valid_values = array(), $case_sensitive = false) { $this->valid_values = array_flip($valid_values); $this->case_sensitive = $case_sensitive; @@ -11074,6 +11067,7 @@ public function __construct($config) $this->info['background-repeat'] = $def->info['background-repeat']; $this->info['background-attachment'] = $def->info['background-attachment']; $this->info['background-position'] = $def->info['background-position']; + $this->info['background-size'] = $def->info['background-size']; } /** @@ -11096,12 +11090,13 @@ public function validate($string, $config, $context) // assumes URI doesn't have spaces in it $bits = explode(' ', $string); // bits to process - $caught = []; + $caught = array(); $caught['color'] = false; $caught['image'] = false; $caught['repeat'] = false; $caught['attachment'] = false; $caught['position'] = false; + $caught['size'] = false; $i = 0; // number of catches @@ -11142,7 +11137,7 @@ public function validate($string, $config, $context) validate($caught['position'], $config, $context); } - $ret = []; + $ret = array(); foreach ($caught as $value) { if ($value === false) { continue; @@ -11232,22 +11227,22 @@ public function validate($string, $config, $context) $string = $this->parseCDATA($string); $bits = explode(' ', $string); - $keywords = []; + $keywords = array(); $keywords['h'] = false; // left, right $keywords['v'] = false; // top, bottom $keywords['ch'] = false; // center (first word) $keywords['cv'] = false; // center (second word) - $measures = []; + $measures = array(); $i = 0; - $lookup = [ + $lookup = array( 'top' => 'v', 'bottom' => 'v', 'left' => 'h', 'right' => 'h', 'center' => 'c' - ]; + ); foreach ($bits as $bit) { if ($bit === '') { @@ -11288,7 +11283,7 @@ public function validate($string, $config, $context) return false; } // no valid values were caught - $ret = []; + $ret = array(); // first keyword if ($keywords['h']) { @@ -11329,7 +11324,7 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef * Local copy of properties this property is shorthand for. * @type HTMLPurifier_AttrDef[] */ - protected $info = []; + protected $info = array(); /** * @param HTMLPurifier_Config $config @@ -11353,7 +11348,7 @@ public function validate($string, $config, $context) $string = $this->parseCDATA($string); $string = $this->mungeRgb($string); $bits = explode(' ', $string); - $done = []; // segments we've finished + $done = array(); // segments we've finished $ret = ''; // return value foreach ($bits as $bit) { foreach ($this->info as $propname => $validator) { @@ -11435,19 +11430,19 @@ public function validate($color, $config, $context) * Allowed types for values : * parameter_position => [type => max_value] */ - $allowed_types = [ - 1 => ['percentage' => 100, 'integer' => 255], - 2 => ['percentage' => 100, 'integer' => 255], - 3 => ['percentage' => 100, 'integer' => 255], - ]; + $allowed_types = array( + 1 => array('percentage' => 100, 'integer' => 255), + 2 => array('percentage' => 100, 'integer' => 255), + 3 => array('percentage' => 100, 'integer' => 255), + ); $allow_different_types = false; if (strpos($function, 'hsl') !== false) { - $allowed_types = [ - 1 => ['integer' => 360], - 2 => ['percentage' => 100], - 3 => ['percentage' => 100], - ]; + $allowed_types = array( + 1 => array('integer' => 360), + 2 => array('percentage' => 100), + 3 => array('percentage' => 100), + ); $allow_different_types = true; } @@ -11459,7 +11454,7 @@ public function validate($color, $config, $context) } $type = false; - $new_parts = []; + $new_parts = array(); $i = 0; foreach ($parts as $part) { @@ -11674,8 +11669,8 @@ public function validate($value, $config, $context) $parameters_length = strcspn($value, ')', $cursor); $parameters = substr($value, $cursor, $parameters_length); $params = explode(',', $parameters); - $ret_params = []; - $lookup = []; + $ret_params = array(); + $lookup = array(); foreach ($params as $param) { list($key, $value) = explode('=', $param); $key = trim($key); @@ -11724,7 +11719,7 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef * CSSDefinition, this wouldn't be necessary. We'd instantiate * our own copies. */ - protected $info = []; + protected $info = array(); /** * @param HTMLPurifier_Config $config @@ -11748,14 +11743,14 @@ public function __construct($config) */ public function validate($string, $config, $context) { - static $system_fonts = [ + static $system_fonts = array( 'caption' => true, 'icon' => true, 'menu' => true, 'message-box' => true, 'small-caption' => true, 'status-bar' => true - ]; + ); // regular pre-processing $string = $this->parseCDATA($string); @@ -11771,8 +11766,8 @@ public function validate($string, $config, $context) $bits = explode(' ', $string); // bits to process $stage = 0; // this indicates what we're looking for - $caught = []; // which stage 0 properties have we caught? - $stage_1 = ['font-style', 'font-variant', 'font-weight']; + $caught = array(); // which stage 0 properties have we caught? + $stage_1 = array('font-style', 'font-variant', 'font-weight'); $final = ''; // output for ($i = 0, $size = count($bits); $i < $size; $i++) { @@ -11897,23 +11892,21 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef public function __construct() { - $this->mask = '_- '; - for ($c = 'a'; $c <= 'z'; $c++) { - $this->mask .= $c; - } - for ($c = 'A'; $c <= 'Z'; $c++) { - $this->mask .= $c; - } - for ($c = '0'; $c <= '9'; $c++) { - $this->mask .= $c; - } // cast-y, but should be fine - // special bytes used by UTF-8 - for ($i = 0x80; $i <= 0xFF; $i++) { - // We don't bother excluding invalid bytes in this range, - // because the our restriction of well-formed UTF-8 will - // prevent these from ever occurring. - $this->mask .= chr($i); - } + // Lowercase letters + $l = range('a', 'z'); + // Uppercase letters + $u = range('A', 'Z'); + // Digits + $d = range('0', '9'); + // Special bytes used by UTF-8 + $b = array_map('chr', range(0x80, 0xFF)); + // All valid characters for the mask + $c = array_merge($l, $u, $d, $b); + // Concatenate all valid characters into a string + // Use '_- ' as an initial value + $this->mask = array_reduce($c, function ($carry, $value) { + return $carry . $value; + }, '_- '); /* PHP's internal strcspn implementation is @@ -11941,13 +11934,13 @@ public function __construct() */ public function validate($string, $config, $context) { - static $generic_names = [ + static $generic_names = array( 'serif' => true, 'sans-serif' => true, 'monospace' => true, 'fantasy' => true, 'cursive' => true - ]; + ); $allowed_fonts = $config->get('CSS.AllowedFonts'); // assume that no font names contain commas in them @@ -11994,7 +11987,7 @@ public function validate($string, $config, $context) // bugger out on whitespace. form feed (0C) really // shouldn't show up regardless - $font = str_replace(["\n", "\t", "\r", "\x0C"], ' ', $font); + $font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font); // Here, there are various classes of characters which need // to be treated differently: @@ -12317,7 +12310,7 @@ public function validate($string, $config, $context) // assumes URI doesn't have spaces in it $bits = explode(' ', strtolower($string)); // bits to process - $caught = []; + $caught = array(); $caught['type'] = false; $caught['position'] = false; $caught['image'] = false; @@ -12360,7 +12353,7 @@ public function validate($string, $config, $context) return false; } - $ret = []; + $ret = array(); // construct type if ($caught['type']) { @@ -12531,11 +12524,11 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef */ public function validate($string, $config, $context) { - static $allowed_values = [ + static $allowed_values = array( 'line-through' => true, 'overline' => true, 'underline' => true, - ]; + ); $string = strtolower($this->parseCDATA($string)); @@ -12622,11 +12615,11 @@ public function validate($uri_string, $config, $context) } // extra sanity check; should have been done by URI - $result = str_replace(['"', "\\", "\n", "\x0c", "\r"], "", $result); + $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); // suspicious characters are ()'; we're going to percent encode // them for safety. - $result = str_replace(['(', ')', "'"], ['%28', '%29', '%27'], $result); + $result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result); // there's an extra bug where ampersands lose their escaping on // an innerHTML cycle, so a very unlucky query parameter could @@ -12792,7 +12785,7 @@ protected function filter($tokens, $config, $context) { $allowed = $config->get('Attr.AllowedClasses'); $forbidden = $config->get('Attr.ForbiddenClasses'); - $ret = []; + $ret = array(); foreach ($tokens as $token) { if (($allowed === null || isset($allowed[$token])) && !isset($forbidden[$token]) && @@ -12861,6 +12854,23 @@ public function validate($string, $config, $context) +class HTMLPurifier_AttrDef_HTML_ContentEditable extends HTMLPurifier_AttrDef +{ + public function validate($string, $config, $context) + { + $allowed = array('false'); + if ($config->get('HTML.Trusted')) { + $allowed = array('', 'true', 'false'); + } + + $enum = new HTMLPurifier_AttrDef_Enum($allowed); + + return $enum->validate($string, $config, $context); + } +} + + + /** * Special-case enum attribute definition that lazy loads allowed frame targets */ @@ -13168,10 +13178,10 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef */ public function __construct($name) { - $configLookup = [ + $configLookup = array( 'rel' => 'AllowedRel', 'rev' => 'AllowedRev' - ]; + ); if (!isset($configLookup[$name])) { trigger_error( 'Unrecognized attribute name for link ' . @@ -13200,7 +13210,7 @@ public function validate($string, $config, $context) $parts = explode(' ', $string); // lookup to prevent duplicates - $ret_lookup = []; + $ret_lookup = array(); foreach ($parts as $part) { $part = strtolower(trim($part)); if (!isset($allowed[$part])) { @@ -13366,24 +13376,18 @@ public function validate($string, $config, $context) // This doesn't match I18N domain names, but we don't have proper IRI support, // so force users to insert Punycode. - // There is not a good sense in which underscores should be - // allowed, since it's technically not! (And if you go as - // far to allow everything as specified by the DNS spec... - // well, that's literally everything, modulo some space limits - // for the components and the overall name (which, by the way, - // we are NOT checking!). So we (arbitrarily) decide this: - // let's allow underscores wherever we would have allowed - // hyphens, if they are enabled. This is a pretty good match - // for browser behavior, for example, a large number of browsers - // cannot handle foo_.example.com, but foo_bar.example.com is - // fairly well supported. + // Underscores defined as Unreserved Characters in RFC 3986 are + // allowed in a URI. There are cases where we want to consider a + // URI containing "_" such as "_dmarc.example.com". + // Underscores are not allowed in the default. If you want to + // allow it, set Core.AllowHostnameUnderscore to true. $underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : ''; // Based off of RFC 1738, but amended so that // as per RFC 3696, the top label need only not be all numeric. // The productions describing this are: $a = '[a-z]'; // alpha - $an = '[a-z0-9]'; // alphanum + $an = "[a-z0-9$underscore]"; // alphanum $and = "[a-z0-9-$underscore]"; // alphanum | "-" // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum $domainlabel = "$an(?:$and*$an)?"; @@ -13409,12 +13413,12 @@ public function validate($string, $config, $context) // If we have Net_IDNA2 support, we can support IRIs by // punycoding them. (This is the most portable thing to do, // since otherwise we have to assume browsers support - } elseif ($config->get('Core.EnableIDNA')) { - $idna = new Net_IDNA2(['encoding' => 'utf8', 'overlong' => false, 'strict' => true]); + } elseif ($config->get('Core.EnableIDNA') && class_exists('Net_IDNA2')) { + $idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true)); // we need to encode each period separately $parts = explode('.', $string); try { - $new_parts = []; + $new_parts = array(); foreach ($parts as $part) { $encodable = false; for ($i = 0, $c = strlen($part); $i < $c; $i++) { @@ -13789,7 +13793,7 @@ class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform * Lookup array of attribute values to CSS. * @type array */ - protected $enumToCSS = []; + protected $enumToCSS = array(); /** * Case sensitivity of the matching. @@ -13903,10 +13907,10 @@ class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTransform /** * @type array */ - protected $css = [ - 'hspace' => ['left', 'right'], - 'vspace' => ['top', 'bottom'] - ]; + protected $css = array( + 'hspace' => array('left', 'right'), + 'vspace' => array('top', 'bottom') + ); /** * @param string $attr @@ -14060,7 +14064,7 @@ class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform public function __construct($name, $css_name = null) { $this->name = $name; - $this->cssName = $css_name ?: $name; + $this->cssName = $css_name ? $css_name : $name; } /** @@ -14129,6 +14133,11 @@ public function transform($attr, $config, $context) class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform { + /** + * @type HTMLPurifier_AttrDef_HTML_ID + */ + public $idDef; + public function __construct() { $this->idDef = new HTMLPurifier_AttrDef_HTML_ID(); @@ -14295,10 +14304,15 @@ class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTransform */ private $uri; + /** + * @type HTMLPurifier_AttrDef_Enum + */ + public $wmode; + public function __construct() { $this->uri = new HTMLPurifier_AttrDef_URI(true); // embedded - $this->wmode = new HTMLPurifier_AttrDef_Enum(['window', 'opaque', 'transparent']); + $this->wmode = new HTMLPurifier_AttrDef_Enum(array('window', 'opaque', 'transparent')); } /** @@ -14408,7 +14422,11 @@ public function transform($attr, $config, $context) // XXX Kind of inefficient $url = $this->parser->parse($attr['href']); - $scheme = $url->getSchemeObj($config, $context); + + // Ignore invalid schemes (e.g. `javascript:`) + if (!($scheme = $url->getSchemeObj($config, $context))) { + return $attr; + } if ($scheme->browsable && !$url->isBenign($config, $context)) { $attr['target'] = '_blank'; @@ -14443,7 +14461,7 @@ public function transform($attr, $config, $context) if (isset($attr['rel'])) { $rels = explode(' ', $attr['rel']); } else { - $rels = []; + $rels = array(); } if (isset($attr['target']) && !in_array('noopener', $rels)) { $rels[] = 'noopener'; @@ -14481,7 +14499,7 @@ public function transform($attr, $config, $context) if (isset($attr['rel'])) { $rels = explode(' ', $attr['rel']); } else { - $rels = []; + $rels = array(); } if (isset($attr['target']) && !in_array('noreferrer', $rels)) { $rels[] = 'noreferrer'; @@ -14727,7 +14745,7 @@ public function __construct() */ public function validateChildren($children, $config, $context) { - return []; + return array(); } } @@ -14755,7 +14773,9 @@ class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef */ // lying a little bit, so that we can handle ul and ol ourselves // XXX: This whole business with 'wrap' is all a bit unsatisfactory - public $elements = ['li' => true, 'ul' => true, 'ol' => true]; + public $elements = array('li' => true, 'ul' => true, 'ol' => true); + + public $whitespace; /** * @param array $children @@ -14780,7 +14800,7 @@ public function validateChildren($children, $config, $context) } // the new set of children - $result = []; + $result = array(); // a little sanity check to make sure it's not ALL whitespace $all_whitespace = true; @@ -14837,7 +14857,7 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef * Lookup table of allowed elements. * @type array */ - public $elements = []; + public $elements = array(); /** * Whether or not the last passed node was all whitespace. @@ -14894,7 +14914,7 @@ public function validateChildren($children, $config, $context) } // the new set of children - $result = []; + $result = array(); // whether or not parsed character data is allowed // this controls whether or not we silently drop a tag @@ -14982,7 +15002,7 @@ public function validateChildren($children, $config, $context) } elseif ($this->whitespace) { return $children; } else { - return []; + return array(); } } return $result; @@ -15051,7 +15071,7 @@ public function validateChildren($children, $config, $context) $this->elements = $this->real_elements; if ($result === false) { - return []; + return array(); } if ($result === true) { $result = $children; @@ -15060,7 +15080,7 @@ public function validateChildren($children, $config, $context) $def = $config->getHTMLDefinition(); $block_wrap_name = $def->info_block_wrapper; $block_wrap = false; - $ret = []; + $ret = array(); foreach ($result as $node) { if ($block_wrap === false) { @@ -15148,7 +15168,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef /** * @type array */ - public $elements = [ + public $elements = array( 'tr' => true, 'tbody' => true, 'thead' => true, @@ -15156,7 +15176,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef 'caption' => true, 'colgroup' => true, 'col' => true - ]; + ); public function __construct() { @@ -15180,14 +15200,14 @@ public function validateChildren($children, $config, $context) $tfoot = false; // whitespace - $initial_ws = []; - $after_caption_ws = []; - $after_thead_ws = []; - $after_tfoot_ws = []; + $initial_ws = array(); + $after_caption_ws = array(); + $after_thead_ws = array(); + $after_tfoot_ws = array(); // as many of these as you want - $cols = []; - $content = []; + $cols = array(); + $content = array(); $tbody_mode = false; // if true, then we need to wrap any stray // s with a . @@ -15268,7 +15288,7 @@ public function validateChildren($children, $config, $context) } } - if (empty($content)) { + if (empty($content) && $thead === false && $tfoot === false) { return false; } @@ -15294,6 +15314,9 @@ public function validateChildren($children, $config, $context) $current_tr_tbody = null; foreach($content as $node) { + if (!isset($node->name)) { + continue; + } switch ($node->name) { case 'tbody': $current_tr_tbody = null; @@ -15806,13 +15829,14 @@ private function _testPermissions($dir, $chmod) } elseif (filegroup($dir) === posix_getgid()) { $chmod = $chmod | 0070; } else { - // PHP's probably running as nobody, so we'll - // need to give global permissions - $chmod = $chmod | 0777; + // PHP's probably running as nobody, it is + // not obvious how to fix this (777 is probably + // bad if you are multi-user), let the user figure it out + $chmod = null; } trigger_error( - 'Directory ' . $dir . ' not writable, ' . - 'please chmod to ' . decoct($chmod), + 'Directory ' . $dir . ' not writable. ' . + ($chmod === null ? '' : 'Please chmod to ' . decoct($chmod)), E_USER_WARNING ); } else { @@ -16011,9 +16035,9 @@ class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule /** * @type array */ - public $attr_collections = [ - 'I18N' => ['dir' => false] - ]; + public $attr_collections = array( + 'I18N' => array('dir' => false) + ); /** * @param HTMLPurifier_Config $config @@ -16024,12 +16048,12 @@ public function setup($config) 'bdo', 'Inline', 'Inline', - ['Core', 'Lang'], - [ + array('Core', 'Lang'), + array( 'dir' => 'Enum#ltr,rtl', // required // The Abstract Module specification has the attribute // inclusions wrong for bdo: bdo allows Lang - ] + ) ); $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir(); @@ -16051,22 +16075,23 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule /** * @type array */ - public $attr_collections = [ - 'Core' => [ - 0 => ['Style'], + public $attr_collections = array( + 'Core' => array( + 0 => array('Style'), // 'xml:space' => false, 'class' => 'Class', 'id' => 'ID', 'title' => 'CDATA', - ], - 'Lang' => [], - 'I18N' => [ - 0 => ['Lang'], // proprietary, for xml:lang/lang - ], - 'Common' => [ - 0 => ['Core', 'I18N'] - ] - ]; + 'contenteditable' => 'ContentEditable', + ), + 'Lang' => array(), + 'I18N' => array( + 0 => array('Lang'), // proprietary, for xml:lang/lang + ), + 'Common' => array( + 0 => array('Core', 'I18N') + ) + ); } @@ -16091,10 +16116,10 @@ class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule public function setup($config) { $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow'; - $attr = [ + $attr = array( 'cite' => 'URI', // 'datetime' => 'Datetime', // not implemented - ]; + ); $this->addElement('del', 'Inline', $contents, 'Common', $attr); $this->addElement('ins', 'Inline', $contents, 'Common', $attr); } @@ -16147,10 +16172,10 @@ class HTMLPurifier_HTMLModule_Forms extends HTMLPurifier_HTMLModule /** * @type array */ - public $content_sets = [ + public $content_sets = array( 'Block' => 'Form', 'Inline' => 'Formctrl', - ]; + ); /** * @param HTMLPurifier_Config $config @@ -16166,23 +16191,23 @@ public function setup($config) 'Form', 'Required: Heading | List | Block | fieldset', 'Common', - [ + array( 'accept' => 'ContentTypes', 'accept-charset' => 'Charsets', 'action*' => 'URI', 'method' => 'Enum#get,post', // really ContentType, but these two are the only ones used today 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', - ] + ) ); - $form->excludes = ['form' => true]; + $form->excludes = array('form' => true); $input = $this->addElement( 'input', 'Formctrl', 'Empty', 'Common', - [ + array( 'accept' => 'ContentTypes', 'accesskey' => 'Character', 'alt' => 'Text', @@ -16196,7 +16221,7 @@ public function setup($config) 'tabindex' => 'Number', 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', 'value' => 'CDATA', - ] + ) ); $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); @@ -16205,13 +16230,13 @@ public function setup($config) 'Formctrl', 'Required: optgroup | option', 'Common', - [ + array( 'disabled' => 'Bool#disabled', 'multiple' => 'Bool#multiple', 'name' => 'CDATA', 'size' => 'Number', 'tabindex' => 'Number', - ] + ) ); $this->addElement( @@ -16219,12 +16244,12 @@ public function setup($config) false, 'Optional: #PCDATA', 'Common', - [ + array( 'disabled' => 'Bool#disabled', 'label' => 'Text', 'selected' => 'Bool#selected', 'value' => 'CDATA', - ] + ) ); // It's illegal for there to be more than one selected, but not // be multiple. Also, no selected means undefined behavior. This might @@ -16235,7 +16260,7 @@ public function setup($config) 'Formctrl', 'Optional: #PCDATA', 'Common', - [ + array( 'accesskey' => 'Character', 'cols*' => 'Number', 'disabled' => 'Bool#disabled', @@ -16243,7 +16268,7 @@ public function setup($config) 'readonly' => 'Bool#readonly', 'rows*' => 'Number', 'tabindex' => 'Number', - ] + ) ); $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); @@ -16252,14 +16277,14 @@ public function setup($config) 'Formctrl', 'Optional: #PCDATA | Heading | List | Block | Inline', 'Common', - [ + array( 'accesskey' => 'Character', 'disabled' => 'Bool#disabled', 'name' => 'CDATA', 'tabindex' => 'Number', 'type' => 'Enum#button,submit,reset', 'value' => 'CDATA', - ] + ) ); // For exclusions, ideally we'd specify content sets, not literal elements @@ -16288,21 +16313,21 @@ public function setup($config) 'Formctrl', 'Optional: #PCDATA | Inline', 'Common', - [ + array( 'accesskey' => 'Character', // 'for' => 'IDREF', // IDREF not implemented, cannot allow - ] + ) ); - $label->excludes = ['label' => true]; + $label->excludes = array('label' => true); $this->addElement( 'legend', false, 'Optional: #PCDATA | Inline', 'Common', - [ + array( 'accesskey' => 'Character', - ] + ) ); $this->addElement( @@ -16310,10 +16335,10 @@ public function setup($config) false, 'Required: option', 'Common', - [ + array( 'disabled' => 'Bool#disabled', 'label*' => 'Text', - ] + ) ); // Don't forget an injector for . This one's a little complex // because it maps to multiple elements. @@ -16345,7 +16370,7 @@ public function setup($config) 'Inline', 'Inline', 'Common', - [ + array( // 'accesskey' => 'Character', // 'charset' => 'Charset', 'href' => 'URI', @@ -16354,10 +16379,10 @@ public function setup($config) 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), // 'tabindex' => 'Number', // 'type' => 'ContentType', - ] + ) ); $a->formatting = true; - $a->excludes = ['a' => true]; + $a->excludes = array('a' => true); } } @@ -16398,7 +16423,7 @@ public function setup($config) 'Inline', 'Flow', 'Common', - [ + array( 'src' => 'URI#embedded', 'width' => 'Length', 'height' => 'Length', @@ -16408,7 +16433,7 @@ public function setup($config) 'longdesc' => 'URI', 'marginheight' => 'Pixels', 'marginwidth' => 'Pixels', - ] + ) ); } } @@ -16441,7 +16466,7 @@ public function setup($config) 'Inline', 'Empty', 'Common', - [ + array( 'alt*' => 'Text', // According to the spec, it's Length, but percents can // be abused, so we allow only Pixels. @@ -16449,7 +16474,7 @@ public function setup($config) 'width' => 'Pixels#' . $max, 'longdesc' => 'URI', 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded - ] + ) ); if ($max === null || $config->get('HTML.Trusted')) { $img->attr['height'] = @@ -16500,12 +16525,12 @@ public function setup($config) 'Inline', 'Empty', null, - [ + array( 'color' => 'Color', 'face' => 'Text', // extremely broad, we should 'size' => 'Text', // tighten it 'id' => 'ID' - ] + ) ); $this->addElement('center', 'Block', 'Flow', 'Common'); $this->addElement( @@ -16513,29 +16538,29 @@ public function setup($config) 'Block', 'Required: li', 'Common', - [ + array( 'compact' => 'Bool#compact' - ] + ) ); $this->addElement( 'font', 'Inline', 'Inline', - ['Core', 'I18N'], - [ + array('Core', 'I18N'), + array( 'color' => 'Color', 'face' => 'Text', // extremely broad, we should 'size' => 'Text', // tighten it - ] + ) ); $this->addElement( 'menu', 'Block', 'Required: li', 'Common', - [ + array( 'compact' => 'Bool#compact' - ] + ) ); $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); @@ -16676,7 +16701,7 @@ class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule /** * @type array */ - public $content_sets = ['Flow' => 'List']; + public $content_sets = array('Flow' => 'List'); /** * @param HTMLPurifier_Config $config @@ -16718,7 +16743,7 @@ class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule */ public function setup($config) { - $elements = ['a', 'applet', 'form', 'frame', 'iframe', 'img', 'map']; + $elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map'); foreach ($elements as $name) { $element = $this->addBlankElement($name); $element->attr['name'] = 'CDATA'; @@ -16769,11 +16794,11 @@ class HTMLPurifier_HTMLModule_NonXMLCommonAttributes extends HTMLPurifier_HTMLMo /** * @type array */ - public $attr_collections = [ - 'Lang' => [ + public $attr_collections = array( + 'Lang' => array( 'lang' => 'LanguageCode', - ] - ]; + ) + ); } @@ -16807,7 +16832,7 @@ public function setup($config) 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', - [ + array( 'archive' => 'URI', 'classid' => 'URI', 'codebase' => 'URI', @@ -16820,7 +16845,7 @@ public function setup($config) 'tabindex' => 'Number', 'type' => 'ContentType', 'width' => 'Length' - ] + ) ); $this->addElement( @@ -16828,13 +16853,13 @@ public function setup($config) false, 'Empty', null, - [ + array( 'id' => 'ID', 'name*' => 'Text', 'type' => 'Text', 'value' => 'Text', 'valuetype' => 'Enum#data,ref,object' - ] + ) ); } } @@ -16907,7 +16932,7 @@ public function setup($config) 'Inline', 'Flow', 'Common', - [ + array( 'direction' => 'Enum#left,right,up,down', 'behavior' => 'Enum#alternate', 'width' => 'Length', @@ -16918,7 +16943,7 @@ public function setup($config) 'bgcolor' => 'Color', 'hspace' => 'Pixels', 'vspace' => 'Pixels', - ] + ) ); } } @@ -16953,9 +16978,9 @@ public function setup($config) $this->addElement('rbc', false, 'Required: rb', 'Common'); $this->addElement('rtc', false, 'Required: rt', 'Common'); $rb = $this->addElement('rb', false, 'Inline', 'Common'); - $rb->excludes = ['ruby' => true]; - $rt = $this->addElement('rt', false, 'Inline', 'Common', ['rbspan' => 'Number']); - $rt->excludes = ['ruby' => true]; + $rb->excludes = array('ruby' => true); + $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); + $rt->excludes = array('ruby' => true); $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); } } @@ -16985,7 +17010,7 @@ public function setup($config) 'Inline', 'Empty', 'Common', - [ + array( 'src*' => 'URI#embedded', 'type' => 'Enum#application/x-shockwave-flash', 'width' => 'Pixels#' . $max, @@ -16995,7 +17020,7 @@ public function setup($config) 'flashvars' => 'Text', 'wmode' => 'Enum#window,transparent,opaque', 'name' => 'ID', - ] + ) ); $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); } @@ -17032,7 +17057,7 @@ public function setup($config) 'Inline', 'Optional: param | Flow | #PCDATA', 'Common', - [ + array( // While technically not required by the spec, we're forcing // it to this value. 'type' => 'Enum#application/x-shockwave-flash', @@ -17040,11 +17065,11 @@ public function setup($config) 'height' => 'Pixels#' . $max, 'data' => 'URI#embedded', 'codebase' => new HTMLPurifier_AttrDef_Enum( - [ + array( 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' - ] + ) ), - ] + ) ); $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); @@ -17053,11 +17078,11 @@ public function setup($config) false, 'Empty', false, - [ + array( 'id' => 'ID', 'name*' => 'Text', 'value' => 'Text' - ] + ) ); $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); $this->info_injector[] = 'SafeObject'; @@ -17093,12 +17118,12 @@ public function setup($config) 'Inline', 'Optional:', // Not `Empty` to not allow to autoclose the )#si', - [$this, 'scriptCallback'], + array($this, 'scriptCallback'), $html ); } @@ -19322,7 +19363,7 @@ public function tokenizeHTML($html, $config, $context) $cursor = 0; // our location in the text $inside_tag = false; // whether or not we're parsing the inside of a tag - $array = []; // result array + $array = array(); // result array // This is also treated to mean maintain *column* numbers too $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); @@ -19566,7 +19607,7 @@ public function tokenizeHTML($html, $config, $context) $context ); } else { - $attr = []; + $attr = array(); } if ($is_self_closing) { @@ -19644,7 +19685,7 @@ public function parseAttributeString($string, $config, $context) $string = (string)$string; // quick typecast if ($string == '') { - return []; + return array(); } // no attributes $e = false; @@ -19658,7 +19699,7 @@ public function parseAttributeString($string, $config, $context) $has_space = strpos($string, ' '); if ($num_equal === 0 && !$has_space) { // bool attribute - return [$string => $string]; + return array($string => $string); } elseif ($num_equal === 1 && !$has_space) { // only one attribute list($key, $quoted_value) = explode('=', $string); @@ -19667,10 +19708,10 @@ public function parseAttributeString($string, $config, $context) if ($e) { $e->send(E_ERROR, 'Lexer: Missing attribute key'); } - return []; + return array(); } if (!$quoted_value) { - return [$key => '']; + return array($key => ''); } $first_char = @$quoted_value[0]; $last_char = @$quoted_value[strlen($quoted_value) - 1]; @@ -19695,11 +19736,11 @@ public function parseAttributeString($string, $config, $context) if ($value === false) { $value = ''; } - return [$key => $this->parseAttr($value, $config)]; + return array($key => $this->parseAttr($value, $config)); } // setup loop environment - $array = []; // return assoc array of attributes + $array = array(); // return assoc array of attributes $cursor = 0; // current position in string (moves forward) $size = strlen($string); // size of the string (stays the same) @@ -19837,7 +19878,7 @@ public function __construct($data, $line = null, $col = null) } public function toTokenPair() { - return [new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null]; + return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); } } @@ -19862,13 +19903,13 @@ class HTMLPurifier_Node_Element extends HTMLPurifier_Node * Associative array of the node's attributes. * @type array */ - public $attr = []; + public $attr = array(); /** * List of child elements. * @type array */ - public $children = []; + public $children = array(); /** * Does this use the form or the form, i.e. @@ -19877,9 +19918,9 @@ class HTMLPurifier_Node_Element extends HTMLPurifier_Node */ public $empty = false; - public $endCol = null, $endLine = null, $endArmor = []; + public $endCol = null, $endLine = null, $endArmor = array(); - public function __construct($name, $attr = [], $line = null, $col = null, $armor = []) { + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { $this->name = $name; $this->attr = $attr; $this->line = $line; @@ -19890,12 +19931,12 @@ public function __construct($name, $attr = [], $line = null, $col = null, $armor public function toTokenPair() { // XXX inefficiency here, normalization is not necessary if ($this->empty) { - return [new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null]; + return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); } else { $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); - $end = new HTMLPurifier_Token_End($this->name, [], $this->endLine, $this->endCol, $this->endArmor); + $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); //$end->start = $start; - return [$start, $end]; + return array($start, $end); } } } @@ -19950,7 +19991,7 @@ public function __construct($data, $is_whitespace, $line = null, $col = null) } public function toTokenPair() { - return [new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null]; + return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); } } @@ -19968,7 +20009,7 @@ abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy * List of strategies to run tokens through. * @type HTMLPurifier_Strategy[] */ - protected $strategies = []; + protected $strategies = array(); /** * @param HTMLPurifier_Token[] $tokens @@ -20077,7 +20118,7 @@ public function execute($tokens, $config, $context) // it is organized by parent elements, similar to $stack, // but it is only populated when an element with exclusions is // processed, i.e. there won't be empty exclusions. - $exclude_stack = [$definition->info_parent_def->excludes]; + $exclude_stack = array($definition->info_parent_def->excludes); // variable that contains the start token while we are processing // nodes. This enables error reporting to do its job @@ -20108,12 +20149,12 @@ public function execute($tokens, $config, $context) // children. $parent_def = $definition->info_parent_def; - $stack = [ - [$top_node, + $stack = array( + array($top_node, $parent_def->descendants_are_inline, $parent_def->excludes, // exclusions - 0] - ]; + 0) + ); while (!empty($stack)) { list($node, $is_inline, $excludes, $ix) = array_pop($stack); @@ -20124,14 +20165,14 @@ public function execute($tokens, $config, $context) $child = $node->children[$ix++]; if ($child instanceof HTMLPurifier_Node_Element) { $go = true; - $stack[] = [$node, $is_inline, $excludes, $ix]; - $stack[] = [$child, + $stack[] = array($node, $is_inline, $excludes, $ix); + $stack[] = array($child, // ToDo: I don't think it matters if it's def or // child_def, but double check this... $is_inline || $def->descendants_are_inline, empty($def->excludes) ? $excludes : array_merge($excludes, $def->excludes), - 0]; + 0); break; } }; @@ -20145,7 +20186,7 @@ public function execute($tokens, $config, $context) // XXX I suppose it would be slightly more efficient to // avoid the allocation here and have children // strategies handle it - $children = []; + $children = array(); foreach ($node->children as $child) { if (!$child->dead) $children[] = $child; } @@ -20265,10 +20306,10 @@ public function execute($tokens, $config, $context) $i = false; // injector index list($zipper, $token) = HTMLPurifier_Zipper::fromArray($tokens); if ($token === NULL) { - return []; + return array(); } $reprocess = false; // whether or not to reprocess the same token - $stack = []; + $stack = array(); // member variables $this->stack =& $stack; @@ -20285,7 +20326,7 @@ public function execute($tokens, $config, $context) // -- begin INJECTOR -- - $this->injectors = []; + $this->injectors = array(); $injectors = $config->getBatch('AutoFormat'); $def_injectors = $definition->info_injector; @@ -20539,7 +20580,7 @@ public function execute($tokens, $config, $context) // [TagClosedAuto] $element->armor['MakeWellFormed_TagClosedError'] = true; $element->carryover = true; - $token = $this->processToken([$new_token, $token, $element]); + $token = $this->processToken(array($new_token, $token, $element)); } else { $token = $this->insertBefore($new_token); } @@ -20676,7 +20717,7 @@ public function execute($tokens, $config, $context) } // insert tags, in FORWARD $j order: c,b,a with - $replace = [$token]; + $replace = array($token); for ($j = 1; $j < $c; $j++) { // ...as well as from the insertions $new_token = new HTMLPurifier_Token_End($skipped_tags[$j]->name); @@ -20732,14 +20773,14 @@ protected function processToken($token, $injector = -1) // normalize forms of token if (is_object($token)) { $tmp = $token; - $token = [1, $tmp]; + $token = array(1, $tmp); } if (is_int($token)) { $tmp = $token; - $token = [$tmp]; + $token = array($tmp); } if ($token === false) { - $token = [1]; + $token = array(1); } if (!is_array($token)) { throw new HTMLPurifier_Exception('Invalid token type from injector'); @@ -20764,7 +20805,7 @@ protected function processToken($token, $injector = -1) // of those tokens into the skips of the new tokens (in $token). // Also, mark the newly inserted tokens as having come from // $injector. - $oldskip = isset($old[0]) ? $old[0]->skip : []; + $oldskip = isset($old[0]) ? $old[0]->skip : array(); foreach ($token as $object) { $object->skip = $oldskip; $object->skip[$injector] = true; @@ -20784,7 +20825,7 @@ private function insertBefore($token) { // NB not $this->zipper->insertBefore(), due to positioning // differences - $splice = $this->zipper->splice($this->token, 0, [$token]); + $splice = $this->zipper->splice($this->token, 0, array($token)); return $splice[1]; } @@ -20870,7 +20911,7 @@ public function execute($tokens, $config, $context) { $definition = $config->getHTMLDefinition(); $generator = new HTMLPurifier_Generator($config, $context); - $result = []; + $result = array(); $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); @@ -20879,7 +20920,7 @@ public function execute($tokens, $config, $context) $trusted = $config->get('HTML.Trusted'); $comment_lookup = $config->get('HTML.AllowedComments'); $comment_regexp = $config->get('HTML.AllowedCommentsRegexp'); - $check_comments = $comment_lookup !== [] || $comment_regexp !== null; + $check_comments = $comment_lookup !== array() || $comment_regexp !== null; $remove_script_contents = $config->get('Core.RemoveScriptContents'); $hidden_elements = $config->get('Core.HiddenElements'); @@ -21128,7 +21169,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform /** * @type array */ - protected $_size_lookup = [ + protected $_size_lookup = array( '0' => 'xx-small', '1' => 'xx-small', '2' => 'small', @@ -21143,7 +21184,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform '+2' => '150%', '+3' => '200%', '+4' => '300%' - ]; + ); /** * @param HTMLPurifier_Token_Tag $tag @@ -21330,7 +21371,7 @@ abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token * Associative array of the tag's attributes. * @type array */ - public $attr = []; + public $attr = array(); /** * Non-overloaded constructor, which lower-cases passed tag name. @@ -21341,7 +21382,7 @@ abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token * @param int $col * @param array $armor */ - public function __construct($name, $attr = [], $line = null, $col = null, $armor = []) + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { $this->name = ctype_lower($name) ? $name : strtolower($name); foreach ($attr as $key => $value) { @@ -21595,7 +21636,7 @@ class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter /** * @type array */ - protected $blacklist = []; + protected $blacklist = array(); /** * @param HTMLPurifier_Config $config @@ -21616,7 +21657,7 @@ public function prepare($config) public function filter(&$uri, $config, $context) { foreach ($this->blacklist as $blacklisted_host_fragment) { - if (strpos($uri->host, $blacklisted_host_fragment) !== false) { + if ($uri->host !== null && strpos($uri->host, $blacklisted_host_fragment) !== false) { return false; } } @@ -21645,7 +21686,7 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter /** * @type array */ - protected $basePathStack = []; + protected $basePathStack = array(); /** * @param HTMLPurifier_Config $config @@ -21744,7 +21785,7 @@ public function filter(&$uri, $config, $context) */ private function _collapseStack($stack) { - $result = []; + $result = array(); $is_folder = false; for ($i = 0; isset($stack[$i]); $i++) { $is_folder = false; @@ -21822,7 +21863,7 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter /** * @type array */ - protected $replace = []; + protected $replace = array(); /** * @param HTMLPurifier_Config $config @@ -21887,11 +21928,11 @@ protected function makeReplace($uri, $config, $context) $string = $uri->toString(); // always available $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true); - $token = $context->get('CurrentToken', true); - $this->replace['%n'] = $token ? $token->name : null; - $this->replace['%m'] = $context->get('CurrentAttr', true); - $this->replace['%p'] = $context->get('CurrentCSSProperty', true); + $this->replace['%r'] = $context->get('EmbeddedURI', true) ?: ''; + $token = $context->get('CurrentToken', true) ?: ''; + $this->replace['%n'] = $token ? $token->name : ''; + $this->replace['%m'] = $context->get('CurrentAttr', true) ?: ''; + $this->replace['%p'] = $context->get('CurrentCSSProperty', true) ?: ''; // not always available if ($this->secretKey) { $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey); @@ -21985,13 +22026,13 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme /** * @type array */ - public $allowed_types = [ + public $allowed_types = array( // you better write validation code for other types if you // decide to allow them 'image/jpeg' => true, 'image/gif' => true, 'image/png' => true, - ]; + ); // this is actually irrelevant since we only write out the path // component /** @@ -22068,7 +22109,7 @@ public function doValidate(&$uri, $config, $context) $image_code = exif_imagetype($file); unlink($file); } elseif (function_exists('getimagesize')) { - set_error_handler([$this, 'muteErrorHandler']); + set_error_handler(array($this, 'muteErrorHandler')); $info = getimagesize($file); restore_error_handler(); unlink($file); @@ -22412,11 +22453,11 @@ public function doValidate(&$uri, $config, $context) $uri->host = null; $uri->port = null; - // Delete all non-numeric characters, non-x characters + // Delete all non-numeric characters, commas, and non-x characters // from phone number, EXCEPT for a leading plus sign. - $uri->path = preg_replace('/(?!^\+)[^\dx]/', '', + $uri->path = preg_replace('/(?!^\+)[^\dx,]/', '', // Normalize e(x)tension to lower-case - str_replace('X', 'x', $uri->path)); + str_replace('X', 'x', rawurldecode($uri->path))); return true; } @@ -22486,7 +22527,7 @@ protected function parseImplementation($var, $type, $allow_null) // a single empty string item, but having an empty // array is more intuitive if ($var == '') { - return []; + return array(); } if (strpos($var, "\n") === false && strpos($var, "\r") === false) { // simplistic string to array method that only works @@ -22501,7 +22542,7 @@ protected function parseImplementation($var, $type, $allow_null) } if ($type === self::HASH) { // key:value,key2:value2 - $nvar = []; + $nvar = array(); foreach ($var as $keypair) { $c = explode(':', $keypair, 2); if (!isset($c[1])) { @@ -22520,7 +22561,7 @@ protected function parseImplementation($var, $type, $allow_null) if ($type == self::ALIST) { return $var; } elseif ($type == self::LOOKUP) { - $new = []; + $new = array(); foreach ($var as $key) { $new[$key] = true; } diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php index c2b9ad340..5fa56f7dd 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php @@ -38,7 +38,7 @@ protected function writeHTMLDiv($html) */ protected function export($var) { - if ($var === []) { + if ($var === array()) { return 'array()'; } return var_export($var, true); diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php index 627d8cd51..0e08ae8fe 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php @@ -18,7 +18,7 @@ class HTMLPurifier_ConfigSchema_Interchange * Array of Directive ID => array(directive info) * @type HTMLPurifier_ConfigSchema_Interchange_Directive[] */ - public $directives = []; + public $directives = array(); /** * Adds a directive array to $directives diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php index 56bba16ee..127a39a67 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php @@ -49,7 +49,7 @@ class HTMLPurifier_ConfigSchema_Interchange_Directive * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). * @type HTMLPurifier_ConfigSchema_Interchange_Id[] */ - public $aliases = []; + public $aliases = array(); /** * Hash of value aliases, e.g. array('alt' => 'real'). Null if value @@ -83,7 +83,7 @@ class HTMLPurifier_ConfigSchema_Interchange_Directive * List of external projects this directive depends on, e.g. array('CSSTidy'). * @type array */ - public $external = []; + public $external = array(); } // vim: et sw=4 sts=4 diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php index dd1b0a9df..655e6dd1b 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php @@ -14,7 +14,7 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder */ public function __construct($varParser = null) { - $this->varParser = $varParser ?: new HTMLPurifier_VarParser_Native(); + $this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); } /** @@ -43,7 +43,7 @@ public function buildDir($interchange, $dir = null) $interchange->name = $info['name']; } - $files = []; + $files = array(); $dh = opendir($dir); while (false !== ($file = readdir($dh))) { if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { @@ -189,7 +189,7 @@ protected function evalArray($contents) */ protected function lookup($array) { - $ret = []; + $ret = array(); foreach ($array as $val) { $ret[$val] = true; } diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Validator.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Validator.php index 6bbc15f7b..fb3127788 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Validator.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/Validator.php @@ -25,7 +25,7 @@ class HTMLPurifier_ConfigSchema_Validator * Context-stack to provide easy to read error messages. * @type array */ - protected $context = []; + protected $context = array(); /** * to test default's type. @@ -46,7 +46,7 @@ public function __construct() public function validate($interchange) { $this->interchange = $interchange; - $this->aliases = []; + $this->aliases = array(); // PHP is a bit lax with integer <=> string conversions in // arrays, so we don't use the identical !== comparison foreach ($interchange->directives as $i => $directive) { diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema.ser b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema.ser index a5426c736..3cd756bee 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema.ser +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema.ser @@ -1 +1 @@ -O:25:"HTMLPurifier_ConfigSchema":3:{s:8:"defaults";a:127:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:12:"defaultPlist";O:25:"HTMLPurifier_PropertyList":3:{s:7:"*data";a:127:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:9:"*parent";N;s:8:"*cache";N;}s:4:"info";a:140:{s:19:"Attr.AllowedClasses";i:-8;s:24:"Attr.AllowedFrameTargets";i:8;s:15:"Attr.AllowedRel";i:8;s:15:"Attr.AllowedRev";i:8;s:18:"Attr.ClassUseCDATA";i:-7;s:20:"Attr.DefaultImageAlt";i:-1;s:24:"Attr.DefaultInvalidImage";i:1;s:27:"Attr.DefaultInvalidImageAlt";i:1;s:19:"Attr.DefaultTextDir";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}}s:13:"Attr.EnableID";i:7;s:17:"HTML.EnableAttrID";O:8:"stdClass":2:{s:3:"key";s:13:"Attr.EnableID";s:7:"isAlias";b:1;}s:21:"Attr.ForbiddenClasses";i:8;s:13:"Attr.ID.HTML5";i:-7;s:16:"Attr.IDBlacklist";i:9;s:22:"Attr.IDBlacklistRegexp";i:-1;s:13:"Attr.IDPrefix";i:1;s:18:"Attr.IDPrefixLocal";i:1;s:24:"AutoFormat.AutoParagraph";i:7;s:17:"AutoFormat.Custom";i:9;s:25:"AutoFormat.DisplayLinkURI";i:7;s:18:"AutoFormat.Linkify";i:7;s:33:"AutoFormat.PurifierLinkify.DocURL";i:1;s:37:"AutoFormatParam.PurifierLinkifyDocURL";O:8:"stdClass":2:{s:3:"key";s:33:"AutoFormat.PurifierLinkify.DocURL";s:7:"isAlias";b:1;}s:26:"AutoFormat.PurifierLinkify";i:7;s:32:"AutoFormat.RemoveEmpty.Predicate";i:10;s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";i:8;s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";i:7;s:22:"AutoFormat.RemoveEmpty";i:7;s:39:"AutoFormat.RemoveSpansWithoutAttributes";i:7;s:19:"CSS.AllowDuplicates";i:7;s:18:"CSS.AllowImportant";i:7;s:15:"CSS.AllowTricky";i:7;s:16:"CSS.AllowedFonts";i:-8;s:21:"CSS.AllowedProperties";i:-8;s:17:"CSS.DefinitionRev";i:5;s:23:"CSS.ForbiddenProperties";i:8;s:16:"CSS.MaxImgLength";i:-1;s:15:"CSS.Proprietary";i:7;s:11:"CSS.Trusted";i:7;s:20:"Cache.DefinitionImpl";i:-1;s:20:"Core.DefinitionCache";O:8:"stdClass":2:{s:3:"key";s:20:"Cache.DefinitionImpl";s:7:"isAlias";b:1;}s:20:"Cache.SerializerPath";i:-1;s:27:"Cache.SerializerPermissions";i:-5;s:22:"Core.AggressivelyFixLt";i:7;s:29:"Core.AggressivelyRemoveScript";i:7;s:28:"Core.AllowHostnameUnderscore";i:7;s:23:"Core.AllowParseManyTags";i:7;s:18:"Core.CollectErrors";i:7;s:18:"Core.ColorKeywords";i:10;s:30:"Core.ConvertDocumentToFragment";i:7;s:24:"Core.AcceptFullDocuments";O:8:"stdClass":2:{s:3:"key";s:30:"Core.ConvertDocumentToFragment";s:7:"isAlias";b:1;}s:36:"Core.DirectLexLineNumberSyncInterval";i:5;s:20:"Core.DisableExcludes";i:7;s:15:"Core.EnableIDNA";i:7;s:13:"Core.Encoding";i:2;s:26:"Core.EscapeInvalidChildren";i:7;s:22:"Core.EscapeInvalidTags";i:7;s:29:"Core.EscapeNonASCIICharacters";i:7;s:19:"Core.HiddenElements";i:8;s:13:"Core.Language";i:1;s:24:"Core.LegacyEntityDecoder";i:7;s:14:"Core.LexerImpl";i:-11;s:24:"Core.MaintainLineNumbers";i:-7;s:22:"Core.NormalizeNewlines";i:7;s:21:"Core.RemoveInvalidImg";i:7;s:33:"Core.RemoveProcessingInstructions";i:7;s:25:"Core.RemoveScriptContents";i:-7;s:13:"Filter.Custom";i:9;s:34:"Filter.ExtractStyleBlocks.Escaping";i:7;s:33:"Filter.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:38:"FilterParam.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:31:"Filter.ExtractStyleBlocks.Scope";i:-1;s:30:"Filter.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:35:"FilterParam.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:34:"Filter.ExtractStyleBlocks.TidyImpl";i:-11;s:38:"FilterParam.ExtractStyleBlocksTidyImpl";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.TidyImpl";s:7:"isAlias";b:1;}s:25:"Filter.ExtractStyleBlocks";i:7;s:14:"Filter.YouTube";i:7;s:12:"HTML.Allowed";i:-4;s:22:"HTML.AllowedAttributes";i:-8;s:20:"HTML.AllowedComments";i:8;s:26:"HTML.AllowedCommentsRegexp";i:-1;s:20:"HTML.AllowedElements";i:-8;s:19:"HTML.AllowedModules";i:-8;s:23:"HTML.Attr.Name.UseCDATA";i:7;s:17:"HTML.BlockWrapper";i:1;s:16:"HTML.CoreModules";i:8;s:18:"HTML.CustomDoctype";i:-1;s:17:"HTML.DefinitionID";i:-1;s:18:"HTML.DefinitionRev";i:5;s:12:"HTML.Doctype";O:8:"stdClass":3:{s:4:"type";i:1;s:10:"allow_null";b:1;s:7:"allowed";a:5:{s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}}s:25:"HTML.FlashAllowFullScreen";i:7;s:24:"HTML.ForbiddenAttributes";i:8;s:22:"HTML.ForbiddenElements";i:8;s:10:"HTML.Forms";i:7;s:17:"HTML.MaxImgLength";i:-5;s:13:"HTML.Nofollow";i:7;s:11:"HTML.Parent";i:1;s:16:"HTML.Proprietary";i:7;s:14:"HTML.SafeEmbed";i:7;s:15:"HTML.SafeIframe";i:7;s:15:"HTML.SafeObject";i:7;s:18:"HTML.SafeScripting";i:8;s:11:"HTML.Strict";i:7;s:16:"HTML.TargetBlank";i:7;s:19:"HTML.TargetNoopener";i:7;s:21:"HTML.TargetNoreferrer";i:7;s:12:"HTML.TidyAdd";i:8;s:14:"HTML.TidyLevel";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}}s:15:"HTML.TidyRemove";i:8;s:12:"HTML.Trusted";i:7;s:10:"HTML.XHTML";i:7;s:10:"Core.XHTML";O:8:"stdClass":2:{s:3:"key";s:10:"HTML.XHTML";s:7:"isAlias";b:1;}s:28:"Output.CommentScriptContents";i:7;s:26:"Core.CommentScriptContents";O:8:"stdClass":2:{s:3:"key";s:28:"Output.CommentScriptContents";s:7:"isAlias";b:1;}s:19:"Output.FixInnerHTML";i:7;s:18:"Output.FlashCompat";i:7;s:14:"Output.Newline";i:-1;s:15:"Output.SortAttr";i:7;s:17:"Output.TidyFormat";i:7;s:15:"Core.TidyFormat";O:8:"stdClass":2:{s:3:"key";s:17:"Output.TidyFormat";s:7:"isAlias";b:1;}s:17:"Test.ForceNoIconv";i:7;s:18:"URI.AllowedSchemes";i:8;s:8:"URI.Base";i:-1;s:17:"URI.DefaultScheme";i:-1;s:16:"URI.DefinitionID";i:-1;s:17:"URI.DefinitionRev";i:5;s:11:"URI.Disable";i:7;s:15:"Attr.DisableURI";O:8:"stdClass":2:{s:3:"key";s:11:"URI.Disable";s:7:"isAlias";b:1;}s:19:"URI.DisableExternal";i:7;s:28:"URI.DisableExternalResources";i:7;s:20:"URI.DisableResources";i:7;s:8:"URI.Host";i:-1;s:17:"URI.HostBlacklist";i:9;s:16:"URI.MakeAbsolute";i:7;s:9:"URI.Munge";i:-1;s:18:"URI.MungeResources";i:7;s:18:"URI.MungeSecretKey";i:-1;s:26:"URI.OverrideAllowedSchemes";i:7;s:20:"URI.SafeIframeRegexp";i:-1;}} \ No newline at end of file +O:25:"HTMLPurifier_ConfigSchema":3:{s:8:"defaults";a:128:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:17:"Core.RemoveBlanks";b:0;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:12:"defaultPlist";O:25:"HTMLPurifier_PropertyList":3:{s:7:"*data";a:128:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:17:"Core.RemoveBlanks";b:0;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:9:"*parent";N;s:8:"*cache";N;}s:4:"info";a:141:{s:19:"Attr.AllowedClasses";i:-8;s:24:"Attr.AllowedFrameTargets";i:8;s:15:"Attr.AllowedRel";i:8;s:15:"Attr.AllowedRev";i:8;s:18:"Attr.ClassUseCDATA";i:-7;s:20:"Attr.DefaultImageAlt";i:-1;s:24:"Attr.DefaultInvalidImage";i:1;s:27:"Attr.DefaultInvalidImageAlt";i:1;s:19:"Attr.DefaultTextDir";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}}s:13:"Attr.EnableID";i:7;s:17:"HTML.EnableAttrID";O:8:"stdClass":2:{s:3:"key";s:13:"Attr.EnableID";s:7:"isAlias";b:1;}s:21:"Attr.ForbiddenClasses";i:8;s:13:"Attr.ID.HTML5";i:-7;s:16:"Attr.IDBlacklist";i:9;s:22:"Attr.IDBlacklistRegexp";i:-1;s:13:"Attr.IDPrefix";i:1;s:18:"Attr.IDPrefixLocal";i:1;s:24:"AutoFormat.AutoParagraph";i:7;s:17:"AutoFormat.Custom";i:9;s:25:"AutoFormat.DisplayLinkURI";i:7;s:18:"AutoFormat.Linkify";i:7;s:33:"AutoFormat.PurifierLinkify.DocURL";i:1;s:37:"AutoFormatParam.PurifierLinkifyDocURL";O:8:"stdClass":2:{s:3:"key";s:33:"AutoFormat.PurifierLinkify.DocURL";s:7:"isAlias";b:1;}s:26:"AutoFormat.PurifierLinkify";i:7;s:32:"AutoFormat.RemoveEmpty.Predicate";i:10;s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";i:8;s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";i:7;s:22:"AutoFormat.RemoveEmpty";i:7;s:39:"AutoFormat.RemoveSpansWithoutAttributes";i:7;s:19:"CSS.AllowDuplicates";i:7;s:18:"CSS.AllowImportant";i:7;s:15:"CSS.AllowTricky";i:7;s:16:"CSS.AllowedFonts";i:-8;s:21:"CSS.AllowedProperties";i:-8;s:17:"CSS.DefinitionRev";i:5;s:23:"CSS.ForbiddenProperties";i:8;s:16:"CSS.MaxImgLength";i:-1;s:15:"CSS.Proprietary";i:7;s:11:"CSS.Trusted";i:7;s:20:"Cache.DefinitionImpl";i:-1;s:20:"Core.DefinitionCache";O:8:"stdClass":2:{s:3:"key";s:20:"Cache.DefinitionImpl";s:7:"isAlias";b:1;}s:20:"Cache.SerializerPath";i:-1;s:27:"Cache.SerializerPermissions";i:-5;s:22:"Core.AggressivelyFixLt";i:7;s:29:"Core.AggressivelyRemoveScript";i:7;s:28:"Core.AllowHostnameUnderscore";i:7;s:23:"Core.AllowParseManyTags";i:7;s:18:"Core.CollectErrors";i:7;s:18:"Core.ColorKeywords";i:10;s:30:"Core.ConvertDocumentToFragment";i:7;s:24:"Core.AcceptFullDocuments";O:8:"stdClass":2:{s:3:"key";s:30:"Core.ConvertDocumentToFragment";s:7:"isAlias";b:1;}s:36:"Core.DirectLexLineNumberSyncInterval";i:5;s:20:"Core.DisableExcludes";i:7;s:15:"Core.EnableIDNA";i:7;s:13:"Core.Encoding";i:2;s:26:"Core.EscapeInvalidChildren";i:7;s:22:"Core.EscapeInvalidTags";i:7;s:29:"Core.EscapeNonASCIICharacters";i:7;s:19:"Core.HiddenElements";i:8;s:13:"Core.Language";i:1;s:24:"Core.LegacyEntityDecoder";i:7;s:14:"Core.LexerImpl";i:-11;s:24:"Core.MaintainLineNumbers";i:-7;s:22:"Core.NormalizeNewlines";i:7;s:17:"Core.RemoveBlanks";i:7;s:21:"Core.RemoveInvalidImg";i:7;s:33:"Core.RemoveProcessingInstructions";i:7;s:25:"Core.RemoveScriptContents";i:-7;s:13:"Filter.Custom";i:9;s:34:"Filter.ExtractStyleBlocks.Escaping";i:7;s:33:"Filter.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:38:"FilterParam.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:31:"Filter.ExtractStyleBlocks.Scope";i:-1;s:30:"Filter.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:35:"FilterParam.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:34:"Filter.ExtractStyleBlocks.TidyImpl";i:-11;s:38:"FilterParam.ExtractStyleBlocksTidyImpl";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.TidyImpl";s:7:"isAlias";b:1;}s:25:"Filter.ExtractStyleBlocks";i:7;s:14:"Filter.YouTube";i:7;s:12:"HTML.Allowed";i:-4;s:22:"HTML.AllowedAttributes";i:-8;s:20:"HTML.AllowedComments";i:8;s:26:"HTML.AllowedCommentsRegexp";i:-1;s:20:"HTML.AllowedElements";i:-8;s:19:"HTML.AllowedModules";i:-8;s:23:"HTML.Attr.Name.UseCDATA";i:7;s:17:"HTML.BlockWrapper";i:1;s:16:"HTML.CoreModules";i:8;s:18:"HTML.CustomDoctype";i:-1;s:17:"HTML.DefinitionID";i:-1;s:18:"HTML.DefinitionRev";i:5;s:12:"HTML.Doctype";O:8:"stdClass":3:{s:4:"type";i:1;s:10:"allow_null";b:1;s:7:"allowed";a:5:{s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}}s:25:"HTML.FlashAllowFullScreen";i:7;s:24:"HTML.ForbiddenAttributes";i:8;s:22:"HTML.ForbiddenElements";i:8;s:10:"HTML.Forms";i:7;s:17:"HTML.MaxImgLength";i:-5;s:13:"HTML.Nofollow";i:7;s:11:"HTML.Parent";i:1;s:16:"HTML.Proprietary";i:7;s:14:"HTML.SafeEmbed";i:7;s:15:"HTML.SafeIframe";i:7;s:15:"HTML.SafeObject";i:7;s:18:"HTML.SafeScripting";i:8;s:11:"HTML.Strict";i:7;s:16:"HTML.TargetBlank";i:7;s:19:"HTML.TargetNoopener";i:7;s:21:"HTML.TargetNoreferrer";i:7;s:12:"HTML.TidyAdd";i:8;s:14:"HTML.TidyLevel";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}}s:15:"HTML.TidyRemove";i:8;s:12:"HTML.Trusted";i:7;s:10:"HTML.XHTML";i:7;s:10:"Core.XHTML";O:8:"stdClass":2:{s:3:"key";s:10:"HTML.XHTML";s:7:"isAlias";b:1;}s:28:"Output.CommentScriptContents";i:7;s:26:"Core.CommentScriptContents";O:8:"stdClass":2:{s:3:"key";s:28:"Output.CommentScriptContents";s:7:"isAlias";b:1;}s:19:"Output.FixInnerHTML";i:7;s:18:"Output.FlashCompat";i:7;s:14:"Output.Newline";i:-1;s:15:"Output.SortAttr";i:7;s:17:"Output.TidyFormat";i:7;s:15:"Core.TidyFormat";O:8:"stdClass":2:{s:3:"key";s:17:"Output.TidyFormat";s:7:"isAlias";b:1;}s:17:"Test.ForceNoIconv";i:7;s:18:"URI.AllowedSchemes";i:8;s:8:"URI.Base";i:-1;s:17:"URI.DefaultScheme";i:-1;s:16:"URI.DefinitionID";i:-1;s:17:"URI.DefinitionRev";i:5;s:11:"URI.Disable";i:7;s:15:"Attr.DisableURI";O:8:"stdClass":2:{s:3:"key";s:11:"URI.Disable";s:7:"isAlias";b:1;}s:19:"URI.DisableExternal";i:7;s:28:"URI.DisableExternalResources";i:7;s:20:"URI.DisableResources";i:7;s:8:"URI.Host";i:-1;s:17:"URI.HostBlacklist";i:9;s:16:"URI.MakeAbsolute";i:7;s:9:"URI.Munge";i:-1;s:18:"URI.MungeResources";i:7;s:18:"URI.MungeSecretKey";i:-1;s:26:"URI.OverrideAllowedSchemes";i:7;s:20:"URI.SafeIframeRegexp";i:-1;}} \ No newline at end of file diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveBlanks.txt b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveBlanks.txt new file mode 100644 index 000000000..95e5285ca --- /dev/null +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveBlanks.txt @@ -0,0 +1,10 @@ +Core.RemoveBlanks +TYPE: bool +DEFAULT: false +VERSION: 4.18 +--DESCRIPTION-- +

+ If set to true, blank nodes will be removed. This can be useful for maintaining + backwards compatibility when upgrading from previous versions of PHP. +

+--# vim: et sw=4 sts=4 diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php index 5d55fb003..6f8e7790e 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php @@ -32,7 +32,7 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter /** * @type array */ - private $_styleMatches = []; + private $_styleMatches = array(); /** * @type csstidy @@ -61,14 +61,14 @@ public function __construct() $this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true); $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( - [ + array( 'first-child', 'link', 'visited', 'active', 'hover', 'focus' - ] + ) ); } @@ -98,9 +98,9 @@ public function preFilter($html, $config, $context) // NB: this must be NON-greedy because if we have // // we must not grab foo in a font-family prop). if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { $css = str_replace( - ['<', '>', '&'], - ['\3C ', '\3E ', '\26 '], + array('<', '>', '&'), + array('\3C ', '\3E ', '\26 '), $css ); } diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php index 5434bfd3f..276d8362f 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php @@ -31,7 +31,7 @@ public function preFilter($html, $config, $context) public function postFilter($html, $config, $context) { $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; - return preg_replace_callback($post_regex, [$this, 'postFilterCallback'], $html); + return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); } /** diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Language/messages/en.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Language/messages/en.php index 64cd92263..c7f197e1e 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Language/messages/en.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Language/messages/en.php @@ -2,7 +2,7 @@ $fallback = false; -$messages = [ +$messages = array( 'HTMLPurifier' => 'HTML Purifier', // for unit testing purposes @@ -44,12 +44,12 @@ 'Strategy_FixNesting: Node contents removed' => 'Contents of $CurrentToken.Compact node removed', 'AttrValidator: Attributes transformed' => 'Attributes on $CurrentToken.Compact transformed from $1.Keys to $2.Keys', 'AttrValidator: Attribute removed' => '$CurrentAttr.Name attribute on $CurrentToken.Compact removed', -]; +); -$errorNames = [ +$errorNames = array( E_ERROR => 'Error', E_WARNING => 'Warning', E_NOTICE => 'Notice' -]; +); // vim: et sw=4 sts=4 diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php index c34121fef..1564f283d 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php @@ -31,7 +31,7 @@ public function tokenizeHTML($html, $config, $context) $context->register('PH5PError', $e); // save the error, so we can detect it return $lexer->tokenizeHTML($html, $config, $context); // use original HTML } - $tokens = []; + $tokens = array(); $this->tokenizeDOM( $doc->getElementsByTagName('html')->item(0)-> // getElementsByTagName('body')->item(0) // @@ -77,7 +77,7 @@ class HTML5 private $token; private $content_model; private $escape = false; - private $entities = [ + private $entities = array( 'AElig;', 'AElig', 'AMP;', @@ -444,7 +444,7 @@ class HTML5 'zeta;', 'zwj;', 'zwnj;' - ]; + ); const PCDATA = 0; const RCDATA = 1; @@ -531,10 +531,10 @@ private function dataState() /* In any case, emit the input character as a character token. Stay in the data state. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => $char - ] + ) ); /* U+003C LESS-THAN SIGN (<) */ @@ -569,10 +569,10 @@ private function dataState() /* In any case, emit the input character as a character token. Stay in the data state. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => $char - ] + ) ); } elseif ($this->char === $this->EOF) { @@ -585,10 +585,10 @@ private function dataState() THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of the text and emit it as a character token. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => substr($this->data, $this->char) - ] + ) ); $this->EOF(); @@ -603,10 +603,10 @@ private function dataState() $this->char += $len - 1; $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => $char - ] + ) ); $this->state = 'data'; @@ -622,10 +622,10 @@ private function entityDataState() // Otherwise, emit the character token that was returned. $char = (!$entity) ? '&' : $entity; $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => $char - ] + ) ); // Finally, switch to the data state. @@ -648,10 +648,10 @@ private function tagOpenState() } else { $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => '<' - ] + ) ); $this->state = 'data'; @@ -680,11 +680,11 @@ private function tagOpenState() version of the input character (add 0x0020 to the character's code point), then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.) */ - $this->token = [ + $this->token = array( 'name' => strtolower($char), 'type' => self::STARTTAG, - 'attr' => [] - ]; + 'attr' => array() + ); $this->state = 'tagName'; @@ -693,10 +693,10 @@ private function tagOpenState() Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+003E GREATER-THAN SIGN character token. Switch to the data state. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => '<>' - ] + ) ); $this->state = 'data'; @@ -711,10 +711,10 @@ private function tagOpenState() Parse error. Emit a U+003C LESS-THAN SIGN character token and reconsume the current input character in the data state. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => '<' - ] + ) ); $this->char--; @@ -751,10 +751,10 @@ private function closeTagOpenState() token, a U+002F SOLIDUS character token, and switch to the data state to process the next input character. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => 'state = 'data'; @@ -772,10 +772,10 @@ private function closeTagOpenState() of the input character (add 0x0020 to the character's code point), then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.) */ - $this->token = [ + $this->token = array( 'name' => strtolower($char), 'type' => self::ENDTAG - ]; + ); $this->state = 'tagName'; @@ -789,10 +789,10 @@ private function closeTagOpenState() Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume the EOF character in the data state. */ $this->emitToken( - [ + array( 'type' => self::CHARACTR, 'data' => 'char--; @@ -891,10 +891,10 @@ private function beforeAttributeNameState() Start a new attribute in the current tag token. Set that attribute's name to the current input character, and its value to the empty string. Switch to the attribute name state. */ - $this->token['attr'][] = [ + $this->token['attr'][] = array( 'name' => strtolower($char), 'value' => null - ]; + ); $this->state = 'attributeName'; } @@ -998,10 +998,10 @@ private function afterAttributeNameState() Start a new attribute in the current tag token. Set that attribute's name to the current input character, and its value to the empty string. Switch to the attribute name state. */ - $this->token['attr'][] = [ + $this->token['attr'][] = array( 'name' => strtolower($char), 'value' => null - ]; + ); $this->state = 'attributeName'; } @@ -1193,10 +1193,10 @@ private function bogusCommentState() the file (EOF), the token is empty.) */ $data = $this->characters('^>', $this->char); $this->emitToken( - [ + array( 'data' => $data, 'type' => self::COMMENT - ] + ) ); $this->char += strlen($data); @@ -1218,10 +1218,10 @@ private function markupDeclarationOpenState() if ($this->character($this->char + 1, 2) === '--') { $this->char += 2; $this->state = 'comment'; - $this->token = [ + $this->token = array( 'data' => null, 'type' => self::COMMENT - ]; + ); /* Otherwise if the next seven chacacters are a case-insensitive match for the word "DOCTYPE", then consume those characters and switch to the @@ -1343,43 +1343,43 @@ private function beforeDoctypeNameState() // Stay in the before DOCTYPE name state. } elseif (preg_match('/^[a-z]$/', $char)) { - $this->token = [ + $this->token = array( 'name' => strtoupper($char), 'type' => self::DOCTYPE, 'error' => true - ]; + ); $this->state = 'doctypeName'; } elseif ($char === '>') { $this->emitToken( - [ + array( 'name' => null, 'type' => self::DOCTYPE, 'error' => true - ] + ) ); $this->state = 'data'; } elseif ($this->char === $this->EOF) { $this->emitToken( - [ + array( 'name' => null, 'type' => self::DOCTYPE, 'error' => true - ] + ) ); $this->char--; $this->state = 'data'; } else { - $this->token = [ + $this->token = array( 'name' => $char, 'type' => self::DOCTYPE, 'error' => true - ]; + ); $this->state = 'doctypeName'; } @@ -1567,28 +1567,28 @@ private function EOF() { $this->state = null; $this->tree->emitToken( - [ + array( 'type' => self::EOF - ] + ) ); } } class HTML5TreeConstructer { - public $stack = []; + public $stack = array(); private $phase; private $mode; private $dom; private $foster_parent = null; - private $a_formatting = []; + private $a_formatting = array(); private $head_pointer = null; private $form_pointer = null; - private $scoping = ['button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th']; - private $formatting = [ + private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); + private $formatting = array( 'a', 'b', 'big', @@ -1602,8 +1602,8 @@ class HTML5TreeConstructer 'strong', 'tt', 'u' - ]; - private $special = [ + ); + private $special = array( 'address', 'area', 'base', @@ -1665,7 +1665,7 @@ class HTML5TreeConstructer 'tr', 'ul', 'wbr' - ]; + ); // The different phases. const INIT_PHASE = 0; @@ -1960,11 +1960,11 @@ private function beforeHead($token) /* Act as if a start tag token with the tag name "head" and no attributes had been seen, then reprocess the current token. */ $this->beforeHead( - [ + array( 'name' => 'head', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); return $this->inHead($token); @@ -1990,7 +1990,7 @@ private function inHead($token) preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( $token['type'] === HTML5::CHARACTR && in_array( end($this->stack)->nodeName, - ['title', 'style', 'script'] + array('title', 'style', 'script') )) ) { /* Append the character to the current node. */ @@ -2003,7 +2003,7 @@ private function inHead($token) $this->insertComment($token['data']); } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], ['title', 'style', 'script']) + in_array($token['name'], array('title', 'style', 'script')) ) { array_pop($this->stack); return HTML5::PCDATA; @@ -2052,7 +2052,7 @@ private function inHead($token) /* A start tag with the tag name "base", "link", or "meta" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - ['base', 'link', 'meta'] + array('base', 'link', 'meta') ) ) { /* Create an element for the token and append the new element to the @@ -2094,10 +2094,10 @@ private function inHead($token) token with the tag name "head" had been seen. */ if ($this->head_pointer->isSameNode(end($this->stack))) { $this->inHead( - [ + array( 'name' => 'head', 'type' => HTML5::ENDTAG - ] + ) ); /* Otherwise, change the insertion mode to "after head". */ @@ -2149,7 +2149,7 @@ private function afterHead($token) "script", "style", "title" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - ['base', 'link', 'meta', 'script', 'style', 'title'] + array('base', 'link', 'meta', 'script', 'style', 'title') ) ) { /* Parse error. Switch the insertion mode back to "in head" and @@ -2162,11 +2162,11 @@ private function afterHead($token) /* Act as if a start tag token with the tag name "body" and no attributes had been seen, and then reprocess the current token. */ $this->afterHead( - [ + array( 'name' => 'body', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); return $this->inBody($token); @@ -2259,10 +2259,10 @@ private function inBody($token) seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2284,10 +2284,10 @@ private function inBody($token) had been seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2307,10 +2307,10 @@ private function inBody($token) seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2358,10 +2358,10 @@ private function inBody($token) seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2383,10 +2383,10 @@ private function inBody($token) then act as if an end tag with the tag name p had been seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2395,7 +2395,7 @@ private function inBody($token) this is a parse error; pop elements from the stack until an element with one of those tag names has been popped from the stack. */ - while ($this->elementInScope(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])) { + while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { array_pop($this->stack); } @@ -2422,10 +2422,10 @@ private function inBody($token) } elseif ($this->a_formatting[$n]->nodeName === 'a') { $this->emitToken( - [ + array( 'name' => 'a', 'type' => HTML5::ENDTAG - ] + ) ); break; } @@ -2475,10 +2475,10 @@ private function inBody($token) do that. Unnecessary.) */ if ($this->elementInScope('button')) { $this->inBody( - [ + array( 'name' => 'button', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2525,10 +2525,10 @@ private function inBody($token) then act as if an end tag with the tag name p had been seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2566,10 +2566,10 @@ private function inBody($token) then act as if an end tag with the tag name p had been seen. */ if ($this->elementInScope('p')) { $this->emitToken( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -2618,41 +2618,41 @@ private function inBody($token) /* Act as if a start tag token with the tag name "form" had been seen. */ $this->inBody( - [ + array( 'name' => 'body', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); /* Act as if a start tag token with the tag name "hr" had been seen. */ $this->inBody( - [ + array( 'name' => 'hr', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); /* Act as if a start tag token with the tag name "p" had been seen. */ $this->inBody( - [ + array( 'name' => 'p', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); /* Act as if a start tag token with the tag name "label" had been seen. */ $this->inBody( - [ + array( 'name' => 'label', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); /* Act as if a stream of character tokens had been seen. */ @@ -2666,14 +2666,14 @@ private function inBody($token) token, except with the "name" attribute set to the value "isindex" (ignoring any explicit "name" attribute). */ $attr = $token['attr']; - $attr[] = ['name' => 'name', 'value' => 'isindex']; + $attr[] = array('name' => 'name', 'value' => 'isindex'); $this->inBody( - [ + array( 'name' => 'input', 'type' => HTML5::STARTTAG, 'attr' => $attr - ] + ) ); /* Act as if a stream of character tokens had been seen @@ -2686,37 +2686,37 @@ private function inBody($token) /* Act as if an end tag token with the tag name "label" had been seen. */ $this->inBody( - [ + array( 'name' => 'label', 'type' => HTML5::ENDTAG - ] + ) ); /* Act as if an end tag token with the tag name "p" had been seen. */ $this->inBody( - [ + array( 'name' => 'p', 'type' => HTML5::ENDTAG - ] + ) ); /* Act as if a start tag token with the tag name "hr" had been seen. */ $this->inBody( - [ + array( 'name' => 'hr', 'type' => HTML5::ENDTAG - ] + ) ); /* Act as if an end tag token with the tag name "form" had been seen. */ $this->inBody( - [ + array( 'name' => 'form', 'type' => HTML5::ENDTAG - ] + ) ); } break; @@ -2824,10 +2824,10 @@ private function inBody($token) then, if that token wasn't ignored, reprocess the current token. */ $this->inBody( - [ + array( 'name' => 'body', 'type' => HTML5::ENDTAG - ] + ) ); return $this->afterBody($token); @@ -2905,7 +2905,7 @@ private function inBody($token) /* If the stack of open elements has a p element in scope, then generate implied end tags, except for p elements. */ if ($this->elementInScope('p')) { - $this->generateImpliedEndTags(['p']); + $this->generateImpliedEndTags(array('p')); /* If the current node is not a p element, then this is a parse error. */ @@ -2934,7 +2934,7 @@ private function inBody($token) generate implied end tags, except for elements with the same tag name as the token. */ if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags([$token['name']]); + $this->generateImpliedEndTags(array($token['name'])); /* If the current node is not an element with the same tag name as the token, then this is a parse error. */ @@ -2962,7 +2962,7 @@ private function inBody($token) case 'h4': case 'h5': case 'h6': - $elements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); /* If the stack of open elements has in scope an element whose tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then @@ -3189,7 +3189,7 @@ private function inBody($token) $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, [$clone], $af_part2); + $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); /* 13. Remove the formatting element from the stack of open elements, and insert the clone into the stack @@ -3202,7 +3202,7 @@ private function inBody($token) $s_part1 = array_slice($this->stack, 0, $fb_s_pos); $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, [$clone], $s_part2); + $this->stack = array_merge($s_part1, array($clone), $s_part2); /* 14. Jump back to step 1 in this series of steps. */ unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); @@ -3315,7 +3315,7 @@ private function inBody($token) private function inTable($token) { - $clear = ['html', 'table']; + $clear = array('html', 'table'); /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), @@ -3367,11 +3367,11 @@ private function inTable($token) $token['name'] === 'col' ) { $this->inTable( - [ + array( 'name' => 'colgroup', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); $this->inColumnGroup($token); @@ -3379,7 +3379,7 @@ private function inTable($token) /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - ['tbody', 'tfoot', 'thead'] + array('tbody', 'tfoot', 'thead') ) ) { /* Clear the stack back to a table context. */ @@ -3392,16 +3392,16 @@ private function inTable($token) /* A start tag whose tag name is one of: "td", "th", "tr" */ } elseif ($token['type'] === HTML5::STARTTAG && - in_array($token['name'], ['td', 'th', 'tr']) + in_array($token['name'], array('td', 'th', 'tr')) ) { /* Act as if a start tag token with the tag name "tbody" had been seen, then reprocess the current token. */ $this->inTable( - [ + array( 'name' => 'tbody', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); return $this->inTableBody($token); @@ -3414,10 +3414,10 @@ private function inTable($token) had been seen, then, if that token wasn't ignored, reprocess the current token. */ $this->inTable( - [ + array( 'name' => 'table', 'type' => HTML5::ENDTAG - ] + ) ); return $this->mainPhase($token); @@ -3460,7 +3460,7 @@ private function inTable($token) "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - [ + array( 'body', 'caption', 'col', @@ -3472,7 +3472,7 @@ private function inTable($token) 'th', 'thead', 'tr' - ] + ) ) ) { // Parse error. Ignore the token. @@ -3487,7 +3487,7 @@ private function inTable($token) node, it must instead be inserted into the foster parent element. */ if (in_array( end($this->stack)->nodeName, - ['table', 'tbody', 'tfoot', 'thead', 'tr'] + array('table', 'tbody', 'tfoot', 'thead', 'tr') ) ) { /* The foster parent element is the parent element of the last @@ -3568,7 +3568,7 @@ private function inCaption($token) name is "table" */ } elseif (($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - [ + array( 'caption', 'col', 'colgroup', @@ -3578,7 +3578,7 @@ private function inCaption($token) 'th', 'thead', 'tr' - ] + ) )) || ($token['type'] === HTML5::ENDTAG && $token['name'] === 'table') ) { @@ -3586,10 +3586,10 @@ private function inCaption($token) had been seen, then, if that token wasn't ignored, reprocess the current token. */ $this->inCaption( - [ + array( 'name' => 'caption', 'type' => HTML5::ENDTAG - ] + ) ); return $this->inTable($token); @@ -3598,7 +3598,7 @@ private function inCaption($token) "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - [ + array( 'body', 'col', 'colgroup', @@ -3608,7 +3608,7 @@ private function inCaption($token) 'th', 'thead', 'tr' - ] + ) ) ) { // Parse error. Ignore the token. @@ -3672,10 +3672,10 @@ private function inColumnGroup($token) /* Act as if an end tag with the tag name "colgroup" had been seen, and then, if that token wasn't ignored, reprocess the current token. */ $this->inColumnGroup( - [ + array( 'name' => 'colgroup', 'type' => HTML5::ENDTAG - ] + ) ); return $this->inTable($token); @@ -3684,7 +3684,7 @@ private function inColumnGroup($token) private function inTableBody($token) { - $clear = ['tbody', 'tfoot', 'thead', 'html']; + $clear = array('tbody', 'tfoot', 'thead', 'html'); /* A start tag whose tag name is "tr" */ if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { @@ -3703,18 +3703,18 @@ private function inTableBody($token) /* Parse error. Act as if a start tag with the tag name "tr" had been seen, then reprocess the current token. */ $this->inTableBody( - [ + array( 'name' => 'tr', 'type' => HTML5::STARTTAG, - 'attr' => [] - ] + 'attr' => array() + ) ); return $this->inRow($token); /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], ['tbody', 'tfoot', 'thead']) + in_array($token['name'], array('tbody', 'tfoot', 'thead')) ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. @@ -3737,14 +3737,14 @@ private function inTableBody($token) "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ } elseif (($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - ['caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'] + array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') )) || ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') ) { /* If the stack of open elements does not have a tbody, thead, or tfoot element in table scope, this is a parse error. Ignore the token. (innerHTML case) */ - if (!$this->elementInScope(['tbody', 'thead', 'tfoot'], true)) { + if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { // Ignore. /* Otherwise: */ @@ -3756,10 +3756,10 @@ private function inTableBody($token) node ("tbody", "tfoot", or "thead") had been seen, then reprocess the current token. */ $this->inTableBody( - [ + array( 'name' => end($this->stack)->nodeName, 'type' => HTML5::ENDTAG - ] + ) ); return $this->mainPhase($token); @@ -3769,7 +3769,7 @@ private function inTableBody($token) "colgroup", "html", "td", "th", "tr" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - ['body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'] + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') ) ) { /* Parse error. Ignore the token. */ @@ -3783,7 +3783,7 @@ private function inTableBody($token) private function inRow($token) { - $clear = ['tr', 'html']; + $clear = array('tr', 'html'); /* A start tag whose tag name is one of: "th", "td" */ if ($token['type'] === HTML5::STARTTAG && @@ -3825,23 +3825,23 @@ private function inRow($token) "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - ['caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'] + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') ) ) { /* Act as if an end tag with the tag name "tr" had been seen, then, if that token wasn't ignored, reprocess the current token. */ $this->inRow( - [ + array( 'name' => 'tr', 'type' => HTML5::ENDTAG - ] + ) ); return $this->inCell($token); /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], ['tbody', 'tfoot', 'thead']) + in_array($token['name'], array('tbody', 'tfoot', 'thead')) ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. @@ -3854,10 +3854,10 @@ private function inRow($token) /* Otherwise, act as if an end tag with the tag name "tr" had been seen, then reprocess the current token. */ $this->inRow( - [ + array( 'name' => 'tr', 'type' => HTML5::ENDTAG - ] + ) ); return $this->inCell($token); @@ -3867,7 +3867,7 @@ private function inRow($token) "colgroup", "html", "td", "th" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - ['body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'] + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') ) ) { /* Parse error. Ignore the token. */ @@ -3895,7 +3895,7 @@ private function inCell($token) } else { /* Generate implied end tags, except for elements with the same tag name as the token. */ - $this->generateImpliedEndTags([$token['name']]); + $this->generateImpliedEndTags(array($token['name'])); /* Now, if the current node is not an element with the same tag name as the token, then this is a parse error. */ @@ -3925,7 +3925,7 @@ private function inCell($token) "tbody", "td", "tfoot", "th", "thead", "tr" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - [ + array( 'caption', 'col', 'colgroup', @@ -3935,13 +3935,13 @@ private function inCell($token) 'th', 'thead', 'tr' - ] + ) ) ) { /* If the stack of open elements does not have a td or th element in table scope, then this is a parse error; ignore the token. (innerHTML case) */ - if (!$this->elementInScope(['td', 'th'], true)) { + if (!$this->elementInScope(array('td', 'th'), true)) { // Ignore. /* Otherwise, close the cell (see below) and reprocess the current @@ -3955,7 +3955,7 @@ private function inCell($token) "tbody", "td", "tfoot", "th", "thead", "tr" */ } elseif ($token['type'] === HTML5::STARTTAG && in_array( $token['name'], - [ + array( 'caption', 'col', 'colgroup', @@ -3965,13 +3965,13 @@ private function inCell($token) 'th', 'thead', 'tr' - ] + ) ) ) { /* If the stack of open elements does not have a td or th element in table scope, then this is a parse error; ignore the token. (innerHTML case) */ - if (!$this->elementInScope(['td', 'th'], true)) { + if (!$this->elementInScope(array('td', 'th'), true)) { // Ignore. /* Otherwise, close the cell (see below) and reprocess the current @@ -3985,7 +3985,7 @@ private function inCell($token) "colgroup", "html" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - ['body', 'caption', 'col', 'colgroup', 'html'] + array('body', 'caption', 'col', 'colgroup', 'html') ) ) { /* Parse error. Ignore the token. */ @@ -3994,7 +3994,7 @@ private function inCell($token) "thead", "tr" */ } elseif ($token['type'] === HTML5::ENDTAG && in_array( $token['name'], - ['table', 'tbody', 'tfoot', 'thead', 'tr'] + array('table', 'tbody', 'tfoot', 'thead', 'tr') ) ) { /* If the stack of open elements does not have an element in table @@ -4041,10 +4041,10 @@ private function inSelect($token) with the tag name "option" had been seen. */ if (end($this->stack)->nodeName === 'option') { $this->inSelect( - [ + array( 'name' => 'option', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -4059,10 +4059,10 @@ private function inSelect($token) with the tag name "option" had been seen. */ if (end($this->stack)->nodeName === 'option') { $this->inSelect( - [ + array( 'name' => 'option', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -4070,10 +4070,10 @@ private function inSelect($token) with the tag name "optgroup" had been seen. */ if (end($this->stack)->nodeName === 'optgroup') { $this->inSelect( - [ + array( 'name' => 'optgroup', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -4094,10 +4094,10 @@ private function inSelect($token) $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' ) { $this->inSelect( - [ + array( 'name' => 'option', 'type' => HTML5::ENDTAG - ] + ) ); } @@ -4153,17 +4153,17 @@ private function inSelect($token) /* Parse error. Act as if the token had been an end tag with the tag name "select" instead. */ $this->inSelect( - [ + array( 'name' => 'select', 'type' => HTML5::ENDTAG - ] + ) ); /* An end tag whose tag name is one of: "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th" */ } elseif (in_array( $token['name'], - [ + array( 'caption', 'table', 'tbody', @@ -4172,7 +4172,7 @@ private function inSelect($token) 'tr', 'td', 'th' - ] + ) ) && $token['type'] === HTML5::ENDTAG ) { /* Parse error. */ @@ -4184,10 +4184,10 @@ private function inSelect($token) Otherwise, ignore the token. */ if ($this->elementInScope($token['name'], true)) { $this->inSelect( - [ + array( 'name' => 'select', 'type' => HTML5::ENDTAG - ] + ) ); $this->mainPhase($token); @@ -4410,7 +4410,7 @@ private function insertElement($token, $append = true, $check = false) foreach ($token['attr'] as $attr) { if (!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); + $el->setAttribute($attr['name'], (string)$attr['value']); } } @@ -4493,14 +4493,14 @@ private function elementInScope($el, $table = false) } elseif ($table === true && in_array( $node->tagName, - [ + array( 'caption', 'td', 'th', 'button', 'marquee', 'object' - ] + ) ) ) { /* 4. Otherwise, if the algorithm is the "has an element in scope" @@ -4617,7 +4617,7 @@ private function clearTheActiveFormattingElementsUpToTheLastMarker() } } - private function generateImpliedEndTags($exclude = []) + private function generateImpliedEndTags($exclude = array()) { /* When the steps below require the UA to generate implied end tags, then, if the current node is a dd element, a dt element, an li element, @@ -4625,7 +4625,7 @@ private function generateImpliedEndTags($exclude = []) act as if an end tag with the respective tag name had been seen and then generate implied end tags again. */ $node = end($this->stack); - $elements = array_diff(['dd', 'dt', 'li', 'p', 'td', 'th', 'tr'], $exclude); + $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); while (in_array(end($this->stack)->nodeName, $elements)) { array_pop($this->stack); @@ -4702,7 +4702,7 @@ private function resetInsertionMode() /* 7. If node is a tbody, thead, or tfoot element, then switch the insertion mode to "in table body" and abort these steps. */ - } elseif (in_array($node->nodeName, ['tbody', 'thead', 'tfoot'])) { + } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { $this->mode = self::IN_TBODY; break; @@ -4767,13 +4767,13 @@ private function closeCell() { /* If the stack of open elements has a td or th element in table scope, then act as if an end tag token with that tag name had been seen. */ - foreach (['td', 'th'] as $cell) { + foreach (array('td', 'th') as $cell) { if ($this->elementInScope($cell, true)) { $this->inCell( - [ + array( 'name' => $cell, 'type' => HTML5::ENDTAG - ] + ) ); break; diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer.php index 6f41dfbc7..549e4cea1 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer.php @@ -48,10 +48,10 @@ public function prepareGenerator($config) * @param array $attr Attribute array * @return string */ - protected function start($tag, $attr = []) + protected function start($tag, $attr = array()) { return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ?: []) + new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) ); } @@ -75,7 +75,7 @@ protected function end($tag) * @param bool $escape whether or not to escape contents * @return string */ - protected function element($tag, $contents, $attr = [], $escape = true) + protected function element($tag, $contents, $attr = array(), $escape = true) { return $this->start($tag, $attr) . ($escape ? $this->escape($contents) : $contents) . @@ -87,7 +87,7 @@ protected function element($tag, $contents, $attr = [], $escape = true) * @param array $attr * @return string */ - protected function elementEmpty($tag, $attr = []) + protected function elementEmpty($tag, $attr = array()) { return $this->generator->generateFromToken( new HTMLPurifier_Token_Empty($tag, $attr) @@ -182,14 +182,14 @@ protected function getClass($obj, $sec_prefix = '') $class .= '('; switch ($lclass) { case 'enum': - $values = []; + $values = array(); foreach ($obj->valid_values as $value => $bool) { $values[] = $value; } $class .= implode(', ', $values); break; case 'css_composite': - $values = []; + $values = array(); foreach ($obj->defs as $def) { $values[] = $this->getClass($def, $sec_prefix); } diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/CSSDefinition.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/CSSDefinition.php index 87ea93085..29505fe12 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/CSSDefinition.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/CSSDefinition.php @@ -16,15 +16,15 @@ public function render($config) $this->def = $config->getCSSDefinition(); $ret = ''; - $ret .= $this->start('div', ['class' => 'HTMLPurifier_Printer']); + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); $ret .= $this->start('table'); $ret .= $this->element('caption', 'Properties ($info)'); $ret .= $this->start('thead'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Property', ['class' => 'heavy']); - $ret .= $this->element('th', 'Definition', ['class' => 'heavy', 'style' => 'width:auto;']); + $ret .= $this->element('th', 'Property', array('class' => 'heavy')); + $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); $ret .= $this->end('tr'); $ret .= $this->end('thead'); diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php index 26319a2d4..4c3ce1758 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php @@ -10,7 +10,7 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer * Printers for specific fields. * @type HTMLPurifier_Printer[] */ - protected $fields = []; + protected $fields = array(); /** * Documentation URL, can have fragment tagged on end. @@ -32,6 +32,11 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer */ protected $compress = false; + /** + * @var HTMLPurifier_Config + */ + protected $genConfig; + /** * @param string $name Form element name for directives to be stuffed into * @param string $doc_url String documentation URL, will have fragment tagged on @@ -104,18 +109,18 @@ public function render($config, $allowed = true, $render_controls = true) $this->prepareGenerator($gen_config); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); - $all = []; + $all = array(); foreach ($allowed as $key) { list($ns, $directive) = $key; $all[$ns][$directive] = $config->get($ns . '.' . $directive); } $ret = ''; - $ret .= $this->start('table', ['class' => 'hp-config']); + $ret .= $this->start('table', array('class' => 'hp-config')); $ret .= $this->start('thead'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', ['class' => 'hp-directive']); - $ret .= $this->element('th', 'Value', ['class' => 'hp-value']); + $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); + $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); $ret .= $this->end('tr'); $ret .= $this->end('thead'); foreach ($all as $ns => $directives) { @@ -124,8 +129,8 @@ public function render($config, $allowed = true, $render_controls = true) if ($render_controls) { $ret .= $this->start('tbody'); $ret .= $this->start('tr'); - $ret .= $this->start('td', ['colspan' => 2, 'class' => 'controls']); - $ret .= $this->elementEmpty('input', ['type' => 'submit', 'value' => 'Submit']); + $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); + $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); $ret .= '[Reset]'; $ret .= $this->end('td'); $ret .= $this->end('tr'); @@ -144,9 +149,9 @@ public function render($config, $allowed = true, $render_controls = true) protected function renderNamespace($ns, $directives) { $ret = ''; - $ret .= $this->start('tbody', ['class' => 'namespace']); + $ret .= $this->start('tbody', array('class' => 'namespace')); $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, ['colspan' => 2]); + $ret .= $this->element('th', $ns, array('colspan' => 2)); $ret .= $this->end('tr'); $ret .= $this->end('tbody'); $ret .= $this->start('tbody'); @@ -155,9 +160,9 @@ protected function renderNamespace($ns, $directives) $ret .= $this->start('th'); if ($this->docURL) { $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); - $ret .= $this->start('a', ['href' => $url]); + $ret .= $this->start('a', array('href' => $url)); } - $attr = ['for' => "{$this->name}:$ns.$directive"]; + $attr = array('for' => "{$this->name}:$ns.$directive"); // crop directive name if it's too long if (!$this->compress || (strlen($directive) < $this->compress)) { @@ -194,7 +199,7 @@ protected function renderNamespace($ns, $directives) if ($allow_null) { $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, [$this->genConfig, $this->config]); + $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); $ret .= $this->end('td'); $ret .= $this->end('tr'); } @@ -243,18 +248,18 @@ public function render($ns, $directive, $value, $name, $config) $this->prepareGenerator($gen_config); $ret = ''; - $ret .= $this->start('label', ['for' => "$name:Null_$ns.$directive"]); - $ret .= $this->element('span', "$ns.$directive:", ['class' => 'verbose']); + $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->text(' Null/Disabled'); $ret .= $this->end('label'); - $attr = [ + $attr = array( 'type' => 'checkbox', 'value' => '1', 'class' => 'null-toggle', 'name' => "$name" . "[Null_$ns.$directive]", 'id' => "$name:Null_$ns.$directive", 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! - ]; + ); if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { // modify inline javascript slightly $attr['onclick'] = @@ -267,7 +272,7 @@ public function render($ns, $directive, $value, $name, $config) $ret .= $this->elementEmpty('input', $attr); $ret .= $this->text(' or '); $ret .= $this->elementEmpty('br'); - $ret .= $this->obj->render($ns, $directive, $value, $name, [$gen_config, $config]); + $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); return $ret; } } @@ -316,7 +321,7 @@ public function render($ns, $directive, $value, $name, $config) switch ($type) { case HTMLPurifier_VarParser::LOOKUP: $array = $value; - $value = []; + $value = array(); foreach ($array as $val => $b) { $value[] = $val; } @@ -343,17 +348,17 @@ public function render($ns, $directive, $value, $name, $config) return 'Not supported'; $value = serialize($value); } - $attr = [ + $attr = array( 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:$ns.$directive" - ]; + ); if ($value === null) { $attr['disabled'] = 'disabled'; } if (isset($def->allowed)) { $ret .= $this->start('select', $attr); foreach ($def->allowed as $val => $b) { - $attr = []; + $attr = array(); if ($value == $val) { $attr['selected'] = 'selected'; } @@ -402,19 +407,19 @@ public function render($ns, $directive, $value, $name, $config) } $this->prepareGenerator($gen_config); $ret = ''; - $ret .= $this->start('div', ['id' => "$name:$ns.$directive"]); + $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); - $ret .= $this->start('label', ['for' => "$name:Yes_$ns.$directive"]); - $ret .= $this->element('span', "$ns.$directive:", ['class' => 'verbose']); + $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->text(' Yes'); $ret .= $this->end('label'); - $attr = [ + $attr = array( 'type' => 'radio', 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:Yes_$ns.$directive", 'value' => '1' - ]; + ); if ($value === true) { $attr['checked'] = 'checked'; } @@ -423,17 +428,17 @@ public function render($ns, $directive, $value, $name, $config) } $ret .= $this->elementEmpty('input', $attr); - $ret .= $this->start('label', ['for' => "$name:No_$ns.$directive"]); - $ret .= $this->element('span', "$ns.$directive:", ['class' => 'verbose']); + $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->text(' No'); $ret .= $this->end('label'); - $attr = [ + $attr = array( 'type' => 'radio', 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:No_$ns.$directive", 'value' => '0' - ]; + ); if ($value === false) { $attr['checked'] = 'checked'; } diff --git a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php index 7d213d297..ae8639176 100644 --- a/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php +++ b/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php @@ -19,7 +19,7 @@ public function render($config) $this->def = $config->getHTMLDefinition(); - $ret .= $this->start('div', ['class' => 'HTMLPurifier_Printer']); + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); $ret .= $this->renderDoctype(); $ret .= $this->renderEnvironment(); @@ -74,7 +74,7 @@ protected function renderEnvironment() $ret .= $this->start('tr'); $ret .= $this->element('th', 'Tag transforms'); - $list = []; + $list = array(); foreach ($def->info_tag_transform as $old => $new) { $new = $this->getClass($new, 'TagTransform_'); $list[] = "<$old> with $new"; @@ -127,11 +127,11 @@ protected function renderInfo() ksort($this->def->info); $ret .= $this->heavyHeader('Allowed tags', 2); $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), ['colspan' => 2]); + $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); $ret .= $this->end('tr'); foreach ($this->def->info as $name => $def) { $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", ['class' => 'heavy', 'colspan' => 2]); + $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); $ret .= $this->end('tr'); $ret .= $this->start('tr'); $ret .= $this->element('th', 'Inline content'); @@ -163,7 +163,7 @@ protected function renderInfo() } $ret .= $this->start('tr'); $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->attr), [], 0); + $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); $ret .= $this->end('tr'); if (!empty($def->required_attr)) { @@ -186,21 +186,21 @@ protected function renderChildren($def) $context = new HTMLPurifier_Context(); $ret = ''; $ret .= $this->start('tr'); - $elements = []; - $attr = []; + $elements = array(); + $attr = array(); if (isset($def->elements)) { if ($def->type == 'strictblockquote') { - $def->validateChildren([], $this->config, $context); + $def->validateChildren(array(), $this->config, $context); } $elements = $def->elements; } if ($def->type == 'chameleon') { $attr['rowspan'] = 2; } elseif ($def->type == 'empty') { - $elements = []; + $elements = array(); } elseif ($def->type == 'table') { $elements = array_flip( - [ + array( 'col', 'caption', 'colgroup', @@ -208,7 +208,7 @@ protected function renderChildren($def) 'tfoot', 'tbody', 'tr' - ] + ) ); } $ret .= $this->element('th', 'Allowed children', $attr); @@ -261,7 +261,7 @@ protected function renderChildren($def) protected function listifyTagLookup($array) { ksort($array); - $list = []; + $list = array(); foreach ($array as $name => $discard) { if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { continue; @@ -280,7 +280,7 @@ protected function listifyTagLookup($array) protected function listifyObjectList($array) { ksort($array); - $list = []; + $list = array(); foreach ($array as $obj) { $list[] = $this->getClass($obj, 'AttrTransform_'); } @@ -295,7 +295,7 @@ protected function listifyObjectList($array) protected function listifyAttr($array) { ksort($array); - $list = []; + $list = array(); foreach ($array as $name => $obj) { if ($obj === false) { continue; @@ -315,7 +315,7 @@ protected function heavyHeader($text, $num = 1) { $ret = ''; $ret .= $this->start('tr'); - $ret .= $this->element('th', $text, ['colspan' => $num, 'class' => 'heavy']); + $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); $ret .= $this->end('tr'); return $ret; }