summaryrefslogtreecommitdiffstats
path: root/vendor/ezyang/htmlpurifier/library
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ezyang/htmlpurifier/library')
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php2
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php2
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier.php6
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php2
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php3
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php4
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php15
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.serbin15000 -> 15305 bytes
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt14
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt2
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php10
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php8
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php15
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php5
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php3
15 files changed, 60 insertions, 31 deletions
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
index 6706f4e39..52acc56b0 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
@@ -1,4 +1,4 @@
<?php
if (!defined('HTMLPURIFIER_PREFIX')) {
- define('HTMLPURIFIER_PREFIX', __DIR__);
+ define('HTMLPURIFIER_PREFIX', dirname(__FILE__));
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
index 9b7b88a87..fdb58c2d3 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.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.6.0
+ * @version 4.7.0
*
* @warning
* You must *not* include any other HTML Purifier files before this file,
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
index 6f654fde5..c6041bc11 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
@@ -19,7 +19,7 @@
*/
/*
- HTML Purifier 4.6.0 - Standards Compliant HTML Filtering
+ HTML Purifier 4.7.0 - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
@@ -58,12 +58,12 @@ class HTMLPurifier
* Version of HTML Purifier.
* @type string
*/
- public $version = '4.6.0';
+ public $version = '4.7.0';
/**
* Constant with version of HTML Purifier.
*/
- const VERSION = '4.6.0';
+ const VERSION = '4.7.0';
/**
* Global configuration object.
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
index 9f266cdd1..e707f871c 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
@@ -44,7 +44,7 @@ class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef
*/
public function validate($string, $config, $context)
{
- $string = $this->parseCDATA($string);
+ $string = $this->mungeRgb($this->parseCDATA($string));
if ($string === '') {
return false;
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
index 036a240e1..dea15d2cd 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
@@ -32,9 +32,6 @@ class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
*/
public function validate($string, $config, $context)
{
- if (empty($string)) {
- return false;
- }
return $this->name;
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
index 0acdee2d9..07cc94175 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
@@ -350,8 +350,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color();
$this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color();
- // technically not proprietary, but CSS3, and no one supports it
- $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
+ // vendor specific prefixes of opacity
$this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
$this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
@@ -404,6 +403,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
array('visible', 'hidden', 'collapse')
);
$this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll'));
+ $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
}
/**
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
index 7ada59b94..2b2db0c26 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
@@ -21,7 +21,7 @@ class HTMLPurifier_Config
* HTML Purifier's version
* @type string
*/
- public $version = '4.6.0';
+ public $version = '4.7.0';
/**
* Whether or not to automatically finalize
@@ -646,16 +646,25 @@ class HTMLPurifier_Config
return $this->getDefinition($name, true, true);
}
+ /**
+ * @return HTMLPurifier_HTMLDefinition
+ */
public function maybeGetRawHTMLDefinition()
{
return $this->getDefinition('HTML', true, true);
}
-
+
+ /**
+ * @return HTMLPurifier_CSSDefinition
+ */
public function maybeGetRawCSSDefinition()
{
return $this->getDefinition('CSS', true, true);
}
-
+
+ /**
+ * @return HTMLPurifier_URIDefinition
+ */
public function maybeGetRawURIDefinition()
{
return $this->getDefinition('URI', true, true);
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
index 22ea32185..1e6ccd227 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
Binary files differ
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt
new file mode 100644
index 000000000..6367fe23c
--- /dev/null
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt
@@ -0,0 +1,14 @@
+AutoFormat.RemoveEmpty.Predicate
+TYPE: hash
+VERSION: 4.7.0
+DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src'))
+--DESCRIPTION--
+<p>
+ Given that an element has no contents, it will be removed by default, unless
+ this predicate dictates otherwise. The predicate can either be an associative
+ map from tag name to list of attributes that must be present for the element
+ to be considered preserved: thus, the default always preserves <code>colgroup</code>,
+ <code>th</code> and <code>td</code>, and also <code>iframe</code> if it
+ has a <code>src</code>.
+</p>
+--# vim: et sw=4 sts=4
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
index a64e3d7c3..6ed70b599 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
@@ -4,6 +4,6 @@ VERSION: 2.0.1
DEFAULT: NULL
--DESCRIPTION--
-A custom doctype for power-users who defined there own document
+A custom doctype for power-users who defined their own document
type. This directive only applies when %HTML.Doctype is blank.
--# vim: et sw=4 sts=4
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
index ecacb88fe..ce268d91b 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
@@ -219,9 +219,15 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
} elseif (!$this->_testPermissions($base, $chmod)) {
return false;
}
- $old = umask(0000);
mkdir($directory, $chmod);
- umask($old);
+ if (!$this->_testPermissions($directory, $chmod)) {
+ trigger_error(
+ 'Base directory ' . $base . ' does not exist,
+ please create or change using %Cache.SerializerPath',
+ E_USER_WARNING
+ );
+ return false;
+ }
} elseif (!$this->_testPermissions($directory, $chmod)) {
return false;
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
index 411519ad6..276d8362f 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
@@ -17,7 +17,7 @@ class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter
public function preFilter($html, $config, $context)
{
$pre_regex = '#<object[^>]+>.+?' .
- 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s';
+ '(?:http:)?//www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s';
$pre_replace = '<span class="youtube-embed">\1</span>';
return preg_replace($pre_regex, $pre_replace, $html);
}
@@ -51,10 +51,10 @@ class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter
{
$url = $this->armorUrl($matches[1]);
return '<object width="425" height="350" type="application/x-shockwave-flash" ' .
- 'data="http://www.youtube.com/' . $url . '">' .
- '<param name="movie" value="http://www.youtube.com/' . $url . '"></param>' .
+ 'data="//www.youtube.com/' . $url . '">' .
+ '<param name="movie" value="//www.youtube.com/' . $url . '"></param>' .
'<!--[if IE]>' .
- '<embed src="http://www.youtube.com/' . $url . '"' .
+ '<embed src="//www.youtube.com/' . $url . '"' .
'type="application/x-shockwave-flash"' .
'wmode="transparent" width="425" height="350" />' .
'<![endif]-->' .
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php
index cd885722e..01353ff1d 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php
@@ -28,10 +28,10 @@ class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector
private $removeNbspExceptions;
/**
+ * Cached contents of %AutoFormat.RemoveEmpty.Predicate
* @type array
- * TODO: make me configurable
*/
- private $_exclude = array('colgroup' => 1, 'th' => 1, 'td' => 1, 'iframe' => 1);
+ private $exclude;
/**
* @param HTMLPurifier_Config $config
@@ -45,6 +45,7 @@ class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector
$this->context = $context;
$this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp');
$this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions');
+ $this->exclude = $config->get('AutoFormat.RemoveEmpty.Predicate');
$this->attrValidator = new HTMLPurifier_AttrValidator();
}
@@ -75,11 +76,15 @@ class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector
break;
}
if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) {
- if (isset($this->_exclude[$token->name])) {
- return;
- }
$this->attrValidator->validateToken($token, $this->config, $this->context);
$token->armor['ValidateAttributes'] = true;
+ if (isset($this->exclude[$token->name])) {
+ $r = true;
+ foreach ($this->exclude[$token->name] as $elem) {
+ if (!isset($token->attr[$elem])) $r = false;
+ }
+ if ($r) return;
+ }
if (isset($token->attr['id']) || isset($token->attr['name'])) {
return;
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
index 720754454..b81819290 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
@@ -75,8 +75,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
$tokens = array();
$this->tokenizeDOM(
$doc->getElementsByTagName('html')->item(0)-> // <html>
- getElementsByTagName('body')->item(0)-> // <body>
- getElementsByTagName('div')->item(0), // <div>
+ getElementsByTagName('body')->item(0), // <body>
$tokens
);
return $tokens;
@@ -272,7 +271,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
$ret .= '<html><head>';
$ret .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
// No protection if $html contains a stray </div>!
- $ret .= '</head><body><div>' . $html . '</div></body></html>';
+ $ret .= '</head><body>' . $html . '</body></html>';
return $ret;
}
}
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php
index a4587e4cd..ff4fa218f 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php
@@ -34,8 +34,7 @@ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex
$tokens = array();
$this->tokenizeDOM(
$doc->getElementsByTagName('html')->item(0)-> // <html>
- getElementsByTagName('body')->item(0)-> // <body>
- getElementsByTagName('div')->item(0) // <div>
+ getElementsByTagName('body')->item(0) // <body>
,
$tokens
);