diff --git a/wire/modules/Markup/MarkupHTMLPurifier/MarkupHTMLPurifier.module b/wire/modules/Markup/MarkupHTMLPurifier/MarkupHTMLPurifier.module index 407aa249..0a85f8e4 100644 --- a/wire/modules/Markup/MarkupHTMLPurifier/MarkupHTMLPurifier.module +++ b/wire/modules/Markup/MarkupHTMLPurifier/MarkupHTMLPurifier.module @@ -33,7 +33,7 @@ class MarkupHTMLPurifier extends WireData implements Module { return array( 'title' => 'HTML Purifier', 'summary' => 'Front-end to the HTML Purifier library.', - 'version' => 496, + 'version' => 497, 'singular' => false, 'autoload' => false, ); @@ -66,6 +66,7 @@ class MarkupHTMLPurifier extends WireData implements Module { * */ public function __construct() { + parent::__construct(); require_once(dirname(__FILE__) . '/htmlpurifier/HTMLPurifier.standalone.php'); $this->settings = \HTMLPurifier_Config::createDefault(); $this->settings->autoFinalize = false; diff --git a/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/HTMLPurifier.standalone.php b/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/HTMLPurifier.standalone.php index a9214aa7..093f3080 100644 --- a/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/HTMLPurifier.standalone.php +++ b/wire/modules/Markup/MarkupHTMLPurifier/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.14.0 + * @version 4.15.0 * * @warning * You must *not* include any other HTML Purifier files before this file, @@ -39,7 +39,7 @@ */ /* - HTML Purifier 4.14.0 - Standards Compliant HTML Filtering + HTML Purifier 4.15.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.14.0'; + public $version = '4.15.0'; /** * Constant with version of HTML Purifier. */ - const VERSION = '4.14.0'; + const VERSION = '4.15.0'; /** * Global configuration object. @@ -314,8 +314,8 @@ class HTMLPurifier } } - - + + /** @@ -387,7 +387,7 @@ class HTMLPurifier_Arborize return $tokens; } } - + /** @@ -535,8 +535,8 @@ class HTMLPurifier_AttrCollections } } - - + + /** @@ -680,8 +680,8 @@ abstract class HTMLPurifier_AttrDef } } - - + + /** @@ -741,8 +741,8 @@ abstract class HTMLPurifier_AttrTransform } } - - + + /** @@ -786,6 +786,7 @@ class HTMLPurifier_AttrTypes $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(); @@ -838,8 +839,8 @@ class HTMLPurifier_AttrTypes } } - - + + /** @@ -1017,8 +1018,8 @@ class HTMLPurifier_AttrValidator } - - + + // constants are slow, so we use as few as possible @@ -1143,8 +1144,8 @@ class HTMLPurifier_Bootstrap } } - - + + /** @@ -1199,8 +1200,8 @@ abstract class HTMLPurifier_Definition } } - - + + /** @@ -1749,8 +1750,8 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition } } - - + + /** @@ -1802,8 +1803,8 @@ abstract class HTMLPurifier_ChildDef abstract public function validateChildren($children, $config, $context); } - - + + /** @@ -1827,7 +1828,7 @@ class HTMLPurifier_Config * HTML Purifier's version * @type string */ - public $version = '4.14.0'; + public $version = '4.15.0'; /** * Whether or not to automatically finalize @@ -2723,8 +2724,8 @@ class HTMLPurifier_Config } - - + + /** @@ -2900,8 +2901,8 @@ class HTMLPurifier_ConfigSchema } } - - + + /** @@ -3071,8 +3072,8 @@ class HTMLPurifier_ContentSets } } - - + + /** @@ -3167,8 +3168,8 @@ class HTMLPurifier_Context } } - - + + /** @@ -3297,8 +3298,8 @@ abstract class HTMLPurifier_DefinitionCache abstract public function cleanup($config); } - - + + /** @@ -3404,8 +3405,8 @@ class HTMLPurifier_DefinitionCacheFactory } } - - + + /** @@ -3478,8 +3479,8 @@ class HTMLPurifier_Doctype } } - - + + class HTMLPurifier_DoctypeRegistry @@ -3621,8 +3622,8 @@ class HTMLPurifier_DoctypeRegistry } } - - + + /** @@ -3801,7 +3802,7 @@ class HTMLPurifier_ElementDef 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)) { @@ -3838,8 +3839,8 @@ class HTMLPurifier_ElementDef } } - - + + /** @@ -4240,8 +4241,8 @@ class HTMLPurifier_Encoder // 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(); @@ -4292,8 +4293,8 @@ class HTMLPurifier_Encoder // 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); @@ -4456,8 +4457,8 @@ class HTMLPurifier_Encoder } } - - + + /** @@ -4505,8 +4506,8 @@ class HTMLPurifier_EntityLookup } } - - + + // if want to implement error collecting here, we'll need to use some sort @@ -4791,8 +4792,8 @@ class HTMLPurifier_EntityParser } } - - + + /** @@ -5036,8 +5037,8 @@ class HTMLPurifier_ErrorCollector } } - - + + /** @@ -5111,8 +5112,8 @@ class HTMLPurifier_ErrorStruct } } - - + + /** @@ -5124,8 +5125,8 @@ class HTMLPurifier_Exception extends Exception } - - + + /** @@ -5181,8 +5182,8 @@ class HTMLPurifier_Filter } } - - + + /** @@ -5468,8 +5469,8 @@ class HTMLPurifier_Generator } } - - + + /** @@ -5962,8 +5963,8 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition } } - - + + /** @@ -6248,8 +6249,8 @@ class HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModuleManager @@ -6716,8 +6717,8 @@ class HTMLPurifier_HTMLModuleManager } } - - + + /** @@ -6774,8 +6775,8 @@ class HTMLPurifier_IDAccumulator } } - - + + /** @@ -7058,8 +7059,8 @@ abstract class HTMLPurifier_Injector } } - - + + /** @@ -7263,8 +7264,8 @@ class HTMLPurifier_Language } } - - + + /** @@ -7473,8 +7474,8 @@ class HTMLPurifier_LanguageFactory } } - - + + /** @@ -7555,7 +7556,7 @@ class HTMLPurifier_Length 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])) { @@ -7636,8 +7637,8 @@ class HTMLPurifier_Length } } - - + + /** @@ -7688,6 +7689,11 @@ class HTMLPurifier_Lexer */ public $tracksLineNumbers = false; + /** + * @type HTMLPurifier_EntityParser + */ + private $_entity_parser; + // -- STATIC ---------------------------------------------------------- /** @@ -7946,8 +7952,8 @@ class HTMLPurifier_Lexer { // 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')) { @@ -8019,8 +8025,8 @@ class HTMLPurifier_Lexer } } - - + + /** @@ -8069,8 +8075,8 @@ abstract class HTMLPurifier_Node abstract public function toTokenPair(); } - - + + /** @@ -8181,8 +8187,8 @@ class HTMLPurifier_PercentEncoder } } - - + + /** @@ -8304,8 +8310,8 @@ class HTMLPurifier_PropertyList } } - - + + /** @@ -8337,7 +8343,7 @@ class HTMLPurifier_PropertyListIterator extends FilterIterator /** * @return bool */ - #[\ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function accept() { $key = $this->getInnerIterator()->key(); @@ -8348,8 +8354,8 @@ class HTMLPurifier_PropertyListIterator extends FilterIterator } } - - + + /** @@ -8406,7 +8412,7 @@ class HTMLPurifier_Queue { return empty($this->input) && empty($this->output); } } - + /** @@ -8432,8 +8438,8 @@ abstract class HTMLPurifier_Strategy abstract public function execute($tokens, $config, $context); } - - + + /** @@ -8456,7 +8462,7 @@ class HTMLPurifier_StringHash extends ArrayObject * @param mixed $index * @return mixed */ - #[\ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($index) { $this->accessed[$index] = true; @@ -8481,8 +8487,8 @@ class HTMLPurifier_StringHash extends ArrayObject } } - - + + /** @@ -8618,8 +8624,8 @@ class HTMLPurifier_StringHashParser } } - - + + /** @@ -8656,8 +8662,8 @@ abstract class HTMLPurifier_TagTransform } } - - + + /** @@ -8757,8 +8763,8 @@ abstract class HTMLPurifier_Token abstract public function toNode(); } - - + + /** @@ -8876,8 +8882,8 @@ class HTMLPurifier_TokenFactory } } - - + + /** @@ -9193,8 +9199,8 @@ class HTMLPurifier_URI } } - - + + class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition @@ -9306,8 +9312,8 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition } - - + + /** @@ -9381,8 +9387,8 @@ abstract class HTMLPurifier_URIFilter abstract public function filter(&$uri, $config, $context); } - - + + /** @@ -9453,8 +9459,8 @@ class HTMLPurifier_URIParser } - - + + /** @@ -9556,8 +9562,8 @@ abstract class HTMLPurifier_URIScheme } } - - + + /** @@ -9638,8 +9644,8 @@ class HTMLPurifier_URISchemeRegistry } } - - + + /** @@ -9946,8 +9952,8 @@ class HTMLPurifier_UnitConverter } } - - + + /** @@ -10145,8 +10151,8 @@ class HTMLPurifier_VarParser } } - - + + /** @@ -10157,8 +10163,8 @@ class HTMLPurifier_VarParserException extends HTMLPurifier_Exception } - - + + /** @@ -10316,7 +10322,7 @@ class HTMLPurifier_Zipper return array($old, $r); } } - + /** @@ -10452,8 +10458,8 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef } - - + + /** @@ -10497,8 +10503,8 @@ class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef } } - - + + // Enum = Enumerated @@ -10571,8 +10577,8 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef } } - - + + /** @@ -10663,8 +10669,8 @@ class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef } } - - + + /** @@ -10750,8 +10756,8 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef } } - - + + /** @@ -10804,8 +10810,8 @@ class HTMLPurifier_AttrDef_Switch } } - - + + /** @@ -10826,8 +10832,8 @@ class HTMLPurifier_AttrDef_Text extends HTMLPurifier_AttrDef } } - - + + /** @@ -10938,8 +10944,8 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef } } - - + + /** @@ -11029,8 +11035,8 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef } } - - + + class HTMLPurifier_AttrDef_CSS_AlphaValue extends HTMLPurifier_AttrDef_CSS_Number @@ -11064,8 +11070,8 @@ class HTMLPurifier_AttrDef_CSS_AlphaValue extends HTMLPurifier_AttrDef_CSS_Numbe } } - - + + /** @@ -11178,8 +11184,8 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef } } - - + + /* W3C says: @@ -11336,8 +11342,8 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef } } - - + + /** @@ -11393,8 +11399,8 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef } } - - + + /** @@ -11555,8 +11561,8 @@ class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef } - - + + /** @@ -11604,8 +11610,8 @@ class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef } } - - + + /** @@ -11649,8 +11655,8 @@ class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef } } - - + + /** @@ -11727,8 +11733,8 @@ class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef } } - - + + /** @@ -11904,8 +11910,8 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef } } - - + + /** @@ -12124,8 +12130,8 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef } - - + + /** @@ -12157,8 +12163,8 @@ class HTMLPurifier_AttrDef_CSS_Ident extends HTMLPurifier_AttrDef } } - - + + /** @@ -12214,8 +12220,8 @@ class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef } } - - + + /** @@ -12292,8 +12298,8 @@ class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef } } - - + + /** @@ -12405,8 +12411,8 @@ class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef } } - - + + /** @@ -12477,8 +12483,8 @@ class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef } } - - + + /** @@ -12532,8 +12538,8 @@ class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef } } - - + + /** @@ -12579,8 +12585,8 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef } } - - + + /** @@ -12657,8 +12663,8 @@ class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI } } - - + + /** @@ -12706,8 +12712,8 @@ class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef } } - - + + /** @@ -12777,8 +12783,8 @@ class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef } } - - + + /** @@ -12827,7 +12833,7 @@ class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_Nmtokens return $ret; } } - + /** @@ -12878,8 +12884,25 @@ class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef } } + + +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); + } +} + /** @@ -12917,8 +12940,8 @@ class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum } } - - + + /** @@ -13031,8 +13054,8 @@ class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef } } - - + + /** @@ -13108,8 +13131,8 @@ class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef } } - - + + /** @@ -13165,8 +13188,8 @@ class HTMLPurifier_AttrDef_HTML_Length extends HTMLPurifier_AttrDef_HTML_Pixels } } - - + + /** @@ -13238,8 +13261,8 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef } } - - + + /** @@ -13299,8 +13322,8 @@ class HTMLPurifier_AttrDef_HTML_MultiLength extends HTMLPurifier_AttrDef_HTML_Le } } - - + + abstract class HTMLPurifier_AttrDef_URI_Email extends HTMLPurifier_AttrDef @@ -13320,8 +13343,8 @@ abstract class HTMLPurifier_AttrDef_URI_Email extends HTMLPurifier_AttrDef // sub-implementations - - + + /** @@ -13463,8 +13486,8 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef } } - - + + /** @@ -13509,8 +13532,8 @@ class HTMLPurifier_AttrDef_URI_IPv4 extends HTMLPurifier_AttrDef } } - - + + /** @@ -13599,8 +13622,8 @@ class HTMLPurifier_AttrDef_URI_IPv6 extends HTMLPurifier_AttrDef_URI_IPv4 } } - - + + /** @@ -13629,8 +13652,8 @@ class HTMLPurifier_AttrDef_URI_Email_SimpleCheck extends HTMLPurifier_AttrDef_UR } } - - + + /** @@ -13658,8 +13681,8 @@ class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTransform } } - - + + // this MUST be placed in post, as it assumes that any value in dir is valid @@ -13686,8 +13709,8 @@ class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform } } - - + + /** @@ -13715,8 +13738,8 @@ class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform } } - - + + /** @@ -13763,8 +13786,8 @@ class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform } } - - + + /** @@ -13790,8 +13813,8 @@ class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform } } - - + + /** @@ -13859,8 +13882,8 @@ class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform } } - - + + // must be called POST validation @@ -13907,8 +13930,8 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform } } - - + + /** @@ -13969,8 +13992,8 @@ class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14026,8 +14049,8 @@ class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14058,8 +14081,8 @@ class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14104,8 +14127,8 @@ class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14138,8 +14161,8 @@ class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14150,6 +14173,11 @@ class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform { + /** + * @type HTMLPurifier_AttrDef_HTML_ID + */ + public $idDef; + public function __construct() { $this->idDef = new HTMLPurifier_AttrDef_HTML_ID(); @@ -14180,8 +14208,8 @@ class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform } } - - + + // must be called POST validation @@ -14233,8 +14261,8 @@ class HTMLPurifier_AttrTransform_Nofollow extends HTMLPurifier_AttrTransform } } - - + + class HTMLPurifier_AttrTransform_SafeEmbed extends HTMLPurifier_AttrTransform @@ -14259,8 +14287,8 @@ class HTMLPurifier_AttrTransform_SafeEmbed extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14288,8 +14316,8 @@ class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14316,6 +14344,11 @@ 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 @@ -14368,8 +14401,8 @@ class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14392,8 +14425,8 @@ class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransfo } } - - + + // must be called POST validation @@ -14438,8 +14471,8 @@ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform } } - - + + // must be called POST validation @@ -14477,7 +14510,7 @@ class HTMLPurifier_AttrTransform_TargetNoopener extends HTMLPurifier_AttrTransfo } } - + // must be called POST validation @@ -14515,7 +14548,7 @@ class HTMLPurifier_AttrTransform_TargetNoreferrer extends HTMLPurifier_AttrTrans } } - + /** @@ -14542,8 +14575,8 @@ class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform } } - - + + /** @@ -14610,8 +14643,8 @@ class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef } } - - + + /** @@ -14713,8 +14746,8 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef } } - - + + /** @@ -14752,8 +14785,8 @@ class HTMLPurifier_ChildDef_Empty extends HTMLPurifier_ChildDef } } - - + + /** @@ -14778,6 +14811,8 @@ class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef // XXX: This whole business with 'wrap' is all a bit unsatisfactory public $elements = array('li' => true, 'ul' => true, 'ol' => true); + public $whitespace; + /** * @param array $children * @param HTMLPurifier_Config $config @@ -14845,8 +14880,8 @@ class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef } } - - + + /** @@ -14964,8 +14999,8 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef } } - - + + /** @@ -15010,8 +15045,8 @@ class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required } } - - + + /** @@ -15121,8 +15156,8 @@ class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildDef_Requi } } - - + + /** @@ -15346,8 +15381,8 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef } } - - + + class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCache @@ -15459,8 +15494,8 @@ class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCach } } - - + + /** @@ -15536,8 +15571,8 @@ class HTMLPurifier_DefinitionCache_Null extends HTMLPurifier_DefinitionCache } } - - + + class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCache @@ -15848,8 +15883,8 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac } } - - + + /** @@ -15927,8 +15962,8 @@ class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends HTMLPurifier_Defini } } - - + + /** @@ -16013,8 +16048,8 @@ class HTMLPurifier_DefinitionCache_Decorator_Memory extends HTMLPurifier_Definit } } - - + + /** @@ -16058,8 +16093,8 @@ class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule @@ -16079,6 +16114,7 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule 'class' => 'Class', 'id' => 'ID', 'title' => 'CDATA', + 'contenteditable' => 'ContentEditable', ), 'Lang' => array(), 'I18N' => array( @@ -16090,8 +16126,8 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule ); } - - + + /** @@ -16146,8 +16182,8 @@ class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16341,8 +16377,8 @@ class HTMLPurifier_HTMLModule_Forms extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16382,8 +16418,8 @@ class HTMLPurifier_HTMLModule_Hypertext extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16434,8 +16470,8 @@ class HTMLPurifier_HTMLModule_Iframe extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16484,8 +16520,8 @@ class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16671,8 +16707,8 @@ class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16723,8 +16759,8 @@ class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule @@ -16750,8 +16786,8 @@ class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16776,8 +16812,8 @@ class HTMLPurifier_HTMLModule_Nofollow extends HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModule_NonXMLCommonAttributes extends HTMLPurifier_HTMLModule @@ -16797,8 +16833,8 @@ class HTMLPurifier_HTMLModule_NonXMLCommonAttributes extends HTMLPurifier_HTMLMo ); } - - + + /** @@ -16860,8 +16896,8 @@ class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16903,8 +16939,8 @@ class HTMLPurifier_HTMLModule_Presentation extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16944,8 +16980,8 @@ class HTMLPurifier_HTMLModule_Proprietary extends HTMLPurifier_HTMLModule } } - - + + /** @@ -16981,8 +17017,8 @@ class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17022,8 +17058,8 @@ class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17085,8 +17121,8 @@ class HTMLPurifier_HTMLModule_SafeObject extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17126,8 +17162,8 @@ class HTMLPurifier_HTMLModule_SafeScripting extends HTMLPurifier_HTMLModule } } - - + + /* @@ -17200,8 +17236,8 @@ class HTMLPurifier_HTMLModule_Scripting extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17234,8 +17270,8 @@ class HTMLPurifier_HTMLModule_StyleAttribute extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17310,8 +17346,8 @@ class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17339,8 +17375,8 @@ class HTMLPurifier_HTMLModule_Target extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17364,8 +17400,8 @@ class HTMLPurifier_HTMLModule_TargetBlank extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17387,7 +17423,7 @@ class HTMLPurifier_HTMLModule_TargetNoopener extends HTMLPurifier_HTMLModule $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetNoopener(); } } - + /** @@ -17409,7 +17445,7 @@ class HTMLPurifier_HTMLModule_TargetNoreferrer extends HTMLPurifier_HTMLModule $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetNoreferrer(); } } - + /** @@ -17496,8 +17532,8 @@ class HTMLPurifier_HTMLModule_Text extends HTMLPurifier_HTMLModule } } - - + + /** @@ -17724,8 +17760,8 @@ class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModule_XMLCommonAttributes extends HTMLPurifier_HTMLModule @@ -17745,8 +17781,8 @@ class HTMLPurifier_HTMLModule_XMLCommonAttributes extends HTMLPurifier_HTMLModul ); } - - + + /** @@ -17779,8 +17815,8 @@ class HTMLPurifier_HTMLModule_Tidy_Name extends HTMLPurifier_HTMLModule_Tidy } } - - + + class HTMLPurifier_HTMLModule_Tidy_Proprietary extends HTMLPurifier_HTMLModule_Tidy @@ -17814,8 +17850,8 @@ class HTMLPurifier_HTMLModule_Tidy_Proprietary extends HTMLPurifier_HTMLModule_T } } - - + + class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule_Tidy @@ -17997,8 +18033,8 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule } } - - + + class HTMLPurifier_HTMLModule_Tidy_Strict extends HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 @@ -18041,8 +18077,8 @@ class HTMLPurifier_HTMLModule_Tidy_Strict extends HTMLPurifier_HTMLModule_Tidy_X } } - - + + class HTMLPurifier_HTMLModule_Tidy_Transitional extends HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 @@ -18058,8 +18094,8 @@ class HTMLPurifier_HTMLModule_Tidy_Transitional extends HTMLPurifier_HTMLModule_ public $defaultLevel = 'heavy'; } - - + + class HTMLPurifier_HTMLModule_Tidy_XHTML extends HTMLPurifier_HTMLModule_Tidy @@ -18085,8 +18121,8 @@ class HTMLPurifier_HTMLModule_Tidy_XHTML extends HTMLPurifier_HTMLModule_Tidy } } - - + + /** @@ -18442,8 +18478,8 @@ class HTMLPurifier_Injector_AutoParagraph extends HTMLPurifier_Injector } } - - + + /** @@ -18483,8 +18519,8 @@ class HTMLPurifier_Injector_DisplayLinkURI extends HTMLPurifier_Injector } } - - + + /** @@ -18551,8 +18587,8 @@ class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector } } - - + + /** @@ -18623,8 +18659,8 @@ class HTMLPurifier_Injector_PurifierLinkify extends HTMLPurifier_Injector } } - - + + class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector @@ -18736,8 +18772,8 @@ class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector } } - - + + /** @@ -18771,6 +18807,16 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In */ private $context; + /** + * @type SplObjectStorage + */ + private $markForDeletion; + + public function __construct() + { + $this->markForDeletion = new SplObjectStorage(); + } + public function prepare($config, $context) { $this->attrValidator = new HTMLPurifier_AttrValidator(); @@ -18804,7 +18850,7 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { // Mark closing span tag for deletion - $current->markForDeletion = true; + $this->markForDeletion->attach($current); // Delete open span tag $token = false; } @@ -18815,14 +18861,15 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In */ public function handleEnd(&$token) { - if ($token->markForDeletion) { + if ($this->markForDeletion->contains($token)) { + $this->markForDeletion->detach($token); $token = false; } } } - - + + /** @@ -18946,8 +18993,8 @@ class HTMLPurifier_Injector_SafeObject extends HTMLPurifier_Injector } } - - + + /** @@ -19285,8 +19332,8 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer } } - - + + /** @@ -19825,8 +19872,8 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer } } - - + + /** @@ -19863,7 +19910,7 @@ class HTMLPurifier_Node_Comment extends HTMLPurifier_Node return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); } } - + /** @@ -19923,7 +19970,7 @@ class HTMLPurifier_Node_Element extends HTMLPurifier_Node } } - + /** @@ -19977,8 +20024,8 @@ class HTMLPurifier_Node_Text extends HTMLPurifier_Node } } - - + + /** @@ -20008,8 +20055,8 @@ abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy } } - - + + /** @@ -20026,8 +20073,8 @@ class HTMLPurifier_Strategy_Core extends HTMLPurifier_Strategy_Composite } } - - + + /** @@ -20208,8 +20255,8 @@ class HTMLPurifier_Strategy_FixNesting extends HTMLPurifier_Strategy } } - - + + /** @@ -20868,8 +20915,8 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // defined, and in any case you probably wanted to operate on trees, // not token streams. - - + + /** @@ -21076,8 +21123,8 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy } } - - + + /** @@ -21122,8 +21169,8 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy } } - - + + /** @@ -21237,8 +21284,8 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform } } - - + + /** @@ -21282,8 +21329,8 @@ class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform } } - - + + /** @@ -21321,8 +21368,8 @@ class HTMLPurifier_Token_Comment extends HTMLPurifier_Token } } - - + + /** @@ -21390,8 +21437,8 @@ abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token } } - - + + /** @@ -21406,8 +21453,8 @@ class HTMLPurifier_Token_Empty extends HTMLPurifier_Token_Tag } } - - + + /** @@ -21431,8 +21478,8 @@ class HTMLPurifier_Token_End extends HTMLPurifier_Token_Tag } } - - + + /** @@ -21442,8 +21489,8 @@ class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag { } - - + + /** @@ -21496,8 +21543,8 @@ class HTMLPurifier_Token_Text extends HTMLPurifier_Token } } - - + + class HTMLPurifier_URIFilter_DisableExternal extends HTMLPurifier_URIFilter @@ -21551,8 +21598,8 @@ class HTMLPurifier_URIFilter_DisableExternal extends HTMLPurifier_URIFilter } } - - + + class HTMLPurifier_URIFilter_DisableExternalResources extends HTMLPurifier_URIFilter_DisableExternal @@ -21577,8 +21624,8 @@ class HTMLPurifier_URIFilter_DisableExternalResources extends HTMLPurifier_URIFi } } - - + + class HTMLPurifier_URIFilter_DisableResources extends HTMLPurifier_URIFilter @@ -21600,8 +21647,8 @@ class HTMLPurifier_URIFilter_DisableResources extends HTMLPurifier_URIFilter } } - - + + // It's not clear to me whether or not Punycode means that hostnames @@ -21639,7 +21686,7 @@ class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter 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; } } @@ -21647,8 +21694,8 @@ class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter } } - - + + // does not support network paths @@ -21806,8 +21853,8 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter } } - - + + class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter @@ -21910,11 +21957,11 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter $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); @@ -21922,8 +21969,8 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter } } - - + + /** @@ -21991,8 +22038,8 @@ class HTMLPurifier_URIFilter_SafeIframe extends HTMLPurifier_URIFilter } } - - + + /** @@ -22129,7 +22176,7 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { } } - + /** @@ -22173,8 +22220,8 @@ class HTMLPurifier_URIScheme_file extends HTMLPurifier_URIScheme } } - - + + /** @@ -22232,8 +22279,8 @@ class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme } } - - + + /** @@ -22269,8 +22316,8 @@ class HTMLPurifier_URIScheme_http extends HTMLPurifier_URIScheme } } - - + + /** @@ -22288,8 +22335,8 @@ class HTMLPurifier_URIScheme_https extends HTMLPurifier_URIScheme_http public $secure = true; } - - + + // VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the @@ -22329,8 +22376,8 @@ class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme } } - - + + /** @@ -22365,8 +22412,8 @@ class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme } } - - + + /** @@ -22398,8 +22445,8 @@ class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme } } - - + + /** @@ -22445,8 +22492,8 @@ class HTMLPurifier_URIScheme_tel extends HTMLPurifier_URIScheme } } - - + + /** @@ -22576,8 +22623,8 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser } } - - + + /** @@ -22615,5 +22662,5 @@ class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser } } - - + + diff --git a/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php b/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php index 6b281a54..6806b38a 100644 --- a/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php +++ b/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php @@ -4410,7 +4410,7 @@ class HTML5TreeConstructer foreach ($token['attr'] as $attr) { if (!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); + $el->setAttribute($attr['name'], (string)$attr['value']); } }