diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index 7a7e9fb89..391b4d1dd 100644 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -14,7 +14,7 @@ $menu = Menu::fromConfig(); ?>
"asd" + ++x;
*/
+ $lock = '"LOCK---' . crc32(time()) . '"';
+
+ $matches = array();
+ preg_match('/([+-])(\s+)([+-])/', $js, $matches);
+ if (empty($matches)) {
+ return $js;
+ }
+
+ $this->locks[$lock] = $matches[2];
+
+ $js = preg_replace('/([+-])\s+([+-])/', "$1{$lock}$2", $js);
+ /* -- */
+
+ return $js;
+ }
+
+ /**
+ * Replace "locks" with the original characters
+ *
+ * @param string $js The string to unlock
+ * @return bool
+ */
+ protected function unlock($js)
+ {
+ if (!count($this->locks)) {
+ return $js;
+ }
+
+ foreach ($this->locks as $lock => $replacement) {
+ $js = str_replace($lock, $replacement, $js);
+ }
+
+ return $js;
+ }
+
}
diff --git a/library/vendor/JShrink/SOURCE b/library/vendor/JShrink/SOURCE
index e01b72fe0..721d70182 100644
--- a/library/vendor/JShrink/SOURCE
+++ b/library/vendor/JShrink/SOURCE
@@ -1,2 +1 @@
-https://github.com/tedivm/JShrink.git
-d9238750fdf763dc4f38631be64866fd84fe5ec8
+https://github.com/tedivm/JShrink/releases/tag/v1.0.0
diff --git a/library/vendor/Parsedown/.gitignore b/library/vendor/Parsedown/.gitignore
deleted file mode 100644
index a7235d425..000000000
--- a/library/vendor/Parsedown/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-.idea
-nbproject
\ No newline at end of file
diff --git a/library/vendor/Parsedown/Parsedown.php b/library/vendor/Parsedown/Parsedown.php
index c848b4ee0..20db13475 100644
--- a/library/vendor/Parsedown/Parsedown.php
+++ b/library/vendor/Parsedown/Parsedown.php
@@ -8,1029 +8,1339 @@
# (c) Emanuil Rusev
# http://erusev.com
#
-# For the full license information, please view the LICENSE file that was
-# distributed with this source code.
+# For the full license information, view the LICENSE file that was distributed
+# with this source code.
#
#
class Parsedown
{
- #
- # Multiton (http://en.wikipedia.org/wiki/Multiton_pattern)
- #
+ #
+ # Philosophy
+
+ # Markdown is intended to be easy-to-read by humans - those of us who read
+ # line by line, left to right, top to bottom. In order to take advantage of
+ # this, Parsedown tries to read in a similar way. It breaks texts into
+ # lines, it iterates through them and it looks at how they start and relate
+ # to each other.
+
+ #
+ # ~
+
+ function text($text)
+ {
+ # standardize line breaks
+ $text = str_replace("\r\n", "\n", $text);
+ $text = str_replace("\r", "\n", $text);
+
+ # replace tabs with spaces
+ $text = str_replace("\t", ' ', $text);
+
+ # remove surrounding line breaks
+ $text = trim($text, "\n");
+
+ # split text into lines
+ $lines = explode("\n", $text);
+
+ # iterate through lines to identify blocks
+ $markup = $this->lines($lines);
+
+ # trim line breaks
+ $markup = trim($markup, "\n");
+
+ # clean up
+ $this->definitions = array();
+
+ return $markup;
+ }
+
+ #
+ # Setters
+ #
+
+ function setBreaksEnabled($breaksEnabled)
+ {
+ $this->breaksEnabled = $breaksEnabled;
+
+ return $this;
+ }
+
+ private $breaksEnabled;
+
+ #
+ # Blocks
+ #
+
+ protected $blockMarkers = array(
+ '#' => array('Atx'),
+ '*' => array('Rule', 'List'),
+ '+' => array('List'),
+ '-' => array('Setext', 'Table', 'Rule', 'List'),
+ '0' => array('List'),
+ '1' => array('List'),
+ '2' => array('List'),
+ '3' => array('List'),
+ '4' => array('List'),
+ '5' => array('List'),
+ '6' => array('List'),
+ '7' => array('List'),
+ '8' => array('List'),
+ '9' => array('List'),
+ ':' => array('Table'),
+ '<' => array('Markup'),
+ '=' => array('Setext'),
+ '>' => array('Quote'),
+ '[' => array('Reference'),
+ '_' => array('Rule'),
+ '`' => array('FencedCode'),
+ '|' => array('Table'),
+ '~' => array('FencedCode'),
+ );
+
+ protected $definitionMarkers = array(
+ '[' => array('Reference'),
+ );
+
+ protected $unmarkedBlockTypes = array(
+ 'CodeBlock',
+ );
+
+ private function lines(array $lines)
+ {
+ $CurrentBlock = null;
+
+ foreach ($lines as $line)
+ {
+ if (chop($line) === '')
+ {
+ if (isset($CurrentBlock))
+ {
+ $CurrentBlock['interrupted'] = true;
+ }
+
+ continue;
+ }
+
+ $indent = 0;
- static function instance($name = 'default')
- {
- if (isset(self::$instances[$name]))
- return self::$instances[$name];
+ while (isset($line[$indent]) and $line[$indent] === ' ')
+ {
+ $indent ++;
+ }
+
+ $text = $indent > 0 ? substr($line, $indent) : $line;
+
+ # ~
+
+ $Line = array('body' => $line, 'indent' => $indent, 'text' => $text);
+
+ # Multiline block types define "addTo" methods.
+
+ if (isset($CurrentBlock['incomplete']))
+ {
+ $Block = $this->{'addTo'.$CurrentBlock['type']}($Line, $CurrentBlock);
+
+ if (isset($Block))
+ {
+ $CurrentBlock = $Block;
+
+ continue;
+ }
+ else
+ {
+ if (method_exists($this, 'complete'.$CurrentBlock['type']))
+ {
+ $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock);
+ }
+
+ unset($CurrentBlock['incomplete']);
+ }
+ }
+
+ # ~
+
+ $marker = $text[0];
+
+ # Definitions
+
+ if (isset($this->definitionMarkers[$marker]))
+ {
+ foreach ($this->definitionMarkers[$marker] as $definitionType)
+ {
+ $Definition = $this->{'identify'.$definitionType}($Line, $CurrentBlock);
+
+ if (isset($Definition))
+ {
+ $this->definitions[$definitionType][$Definition['id']] = $Definition['data'];
+
+ continue 2;
+ }
+ }
+ }
+
+ # ~
+
+ $blockTypes = $this->unmarkedBlockTypes;
- $instance = new Parsedown();
+ if (isset($this->blockMarkers[$marker]))
+ {
+ foreach ($this->blockMarkers[$marker] as $blockType)
+ {
+ $blockTypes []= $blockType;
+ }
+ }
- self::$instances[$name] = $instance;
+ #
+ # ~
- return $instance;
- }
+ foreach ($blockTypes as $blockType)
+ {
+ # Block types define "identify" methods.
- private static $instances = array();
+ $Block = $this->{'identify'.$blockType}($Line, $CurrentBlock);
- #
- # Setters
- #
+ if (isset($Block))
+ {
+ $Block['type'] = $blockType;
- private $breaks_enabled = false;
+ if ( ! isset($Block['identified'])) # »
+ {
+ $Elements []= $CurrentBlock['element'];
- function set_breaks_enabled($breaks_enabled)
- {
- $this->breaks_enabled = $breaks_enabled;
+ $Block['identified'] = true;
+ }
- return $this;
- }
+ # Multiline block types define "addTo" methods.
- #
- # Fields
- #
+ if (method_exists($this, 'addTo'.$blockType))
+ {
+ $Block['incomplete'] = true;
+ }
- private $reference_map = array();
+ $CurrentBlock = $Block;
- #
- # Public Methods
- #
+ continue 2;
+ }
+ }
- function parse($text)
- {
- # removes \r characters
- $text = str_replace("\r\n", "\n", $text);
- $text = str_replace("\r", "\n", $text);
+ # ~
- # replaces tabs with spaces
- $text = str_replace("\t", ' ', $text);
+ if ($CurrentBlock['type'] === 'Paragraph' and ! isset($CurrentBlock['interrupted']))
+ {
+ $CurrentBlock['element']['text'] .= "\n".$text;
+ }
+ else
+ {
+ $Elements []= $CurrentBlock['element'];
+
+ $CurrentBlock = array(
+ 'type' => 'Paragraph',
+ 'identified' => true,
+ 'element' => array(
+ 'name' => 'p',
+ 'text' => $text,
+ 'handler' => 'line',
+ ),
+ );
+ }
+ }
+
+ # ~
+
+ if (isset($CurrentBlock['incomplete']) and method_exists($this, 'complete'.$CurrentBlock['type']))
+ {
+ $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock);
+ }
+
+ # ~
+
+ $Elements []= $CurrentBlock['element'];
- # ~
+ unset($Elements[0]);
+
+ # ~
+
+ $markup = $this->elements($Elements);
+
+ # ~
+
+ return $markup;
+ }
+
+ #
+ # Atx
+
+ protected function identifyAtx($Line)
+ {
+ if (isset($Line['text'][1]))
+ {
+ $level = 1;
+
+ while (isset($Line['text'][$level]) and $Line['text'][$level] === '#')
+ {
+ $level ++;
+ }
+
+ $text = trim($Line['text'], '# ');
+
+ $Block = array(
+ 'element' => array(
+ 'name' => 'h'.$level,
+ 'text' => $text,
+ 'handler' => 'line',
+ ),
+ );
+
+ return $Block;
+ }
+ }
+
+ #
+ # Rule
+
+ protected function identifyRule($Line)
+ {
+ if (preg_match('/^(['.$Line['text'][0].'])([ ]{0,2}\1){2,}[ ]*$/', $Line['text']))
+ {
+ $Block = array(
+ 'element' => array(
+ 'name' => 'hr'
+ ),
+ );
+
+ return $Block;
+ }
+ }
+
+ #
+ # Reference
+
+ protected function identifyReference($Line)
+ {
+ if (preg_match('/^\[(.+?)\]:[ ]*(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches))
+ {
+ $Definition = array(
+ 'id' => strtolower($matches[1]),
+ 'data' => array(
+ 'url' => $matches[2],
+ ),
+ );
+
+ if (isset($matches[3]))
+ {
+ $Definition['data']['title'] = $matches[3];
+ }
+
+ return $Definition;
+ }
+ }
+
+ #
+ # Setext
+
+ protected function identifySetext($Line, array $Block = null)
+ {
+ if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
+ {
+ return;
+ }
+
+ if (chop($Line['text'], $Line['text'][0]) === '')
+ {
+ $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2';
+
+ return $Block;
+ }
+ }
+
+ #
+ # Markup
+
+ protected function identifyMarkup($Line)
+ {
+ if (preg_match('/^<(\w[\w\d]*)(?:[ ][^>\/]*)?(\/?)[ ]*>/', $Line['text'], $matches))
+ {
+ if (in_array($matches[1], $this->textLevelElements))
+ {
+ return;
+ }
+
+ $Block = array(
+ 'element' => $Line['body'],
+ );
+
+ if ($matches[2] or $matches[1] === 'hr' or preg_match('/<\/'.$matches[1].'>[ ]*$/', $Line['text']))
+ {
+ $Block['closed'] = true;
+ }
+ else
+ {
+ $Block['depth'] = 0;
+ $Block['start'] = '<'.$matches[1].'>';
+ $Block['end'] = ''.$matches[1].'>';
+ }
+
+ return $Block;
+ }
+ }
+
+ protected function addToMarkup($Line, array $Block)
+ {
+ if (isset($Block['closed']))
+ {
+ return;
+ }
+
+ if (stripos($Line['text'], $Block['start']) !== false) # opening tag
+ {
+ $Block['depth'] ++;
+ }
+
+ if (stripos($Line['text'], $Block['end']) !== false) # closing tag
+ {
+ if ($Block['depth'] > 0)
+ {
+ $Block['depth'] --;
+ }
+ else
+ {
+ $Block['closed'] = true;
+ }
+ }
+
+ $Block['element'] .= "\n".$Line['body'];
+
+ return $Block;
+ }
+
+ #
+ # Fenced Code
+
+ protected function identifyFencedCode($Line)
+ {
+ if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
+ {
+ $Element = array(
+ 'name' => 'code',
+ 'text' => '',
+ );
+
+ if (isset($matches[2]))
+ {
+ $class = 'language-'.$matches[2];
+
+ $Element['attributes'] = array(
+ 'class' => $class,
+ );
+ }
+
+ $Block = array(
+ 'char' => $Line['text'][0],
+ 'element' => array(
+ 'name' => 'pre',
+ 'handler' => 'element',
+ 'text' => $Element,
+ ),
+ );
+
+ return $Block;
+ }
+ }
+
+ protected function addToFencedCode($Line, $Block)
+ {
+ if (isset($Block['complete']))
+ {
+ return;
+ }
+
+ if (isset($Block['interrupted']))
+ {
+ $Block['element']['text']['text'] .= "\n";
+
+ unset($Block['interrupted']);
+ }
+
+ if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text']))
+ {
+ $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1);
+
+ $Block['complete'] = true;
+
+ return $Block;
+ }
+
+ $Block['element']['text']['text'] .= "\n".$Line['body'];;
+
+ return $Block;
+ }
+
+ protected function completeFencedCode($Block)
+ {
+ $text = $Block['element']['text']['text'];
+
+ $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
+
+ $Block['element']['text']['text'] = $text;
+
+ return $Block;
+ }
+
+ #
+ # List
+
+ protected function identifyList($Line)
+ {
+ list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]');
+
+ if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches))
+ {
+ $Block = array(
+ 'indent' => $Line['indent'],
+ 'pattern' => $pattern,
+ 'element' => array(
+ 'name' => $name,
+ 'handler' => 'elements',
+ ),
+ );
+
+ $Block['li'] = array(
+ 'name' => 'li',
+ 'handler' => 'li',
+ 'text' => array(
+ $matches[2],
+ ),
+ );
+
+ $Block['element']['text'] []= & $Block['li'];
+
+ return $Block;
+ }
+ }
+
+ protected function addToList($Line, array $Block)
+ {
+ if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'[ ]+(.*)/', $Line['text'], $matches))
+ {
+ if (isset($Block['interrupted']))
+ {
+ $Block['li']['text'] []= '';
+
+ unset($Block['interrupted']);
+ }
- $text = trim($text, "\n");
+ unset($Block['li']);
- $lines = explode("\n", $text);
+ $Block['li'] = array(
+ 'name' => 'li',
+ 'handler' => 'li',
+ 'text' => array(
+ $matches[1],
+ ),
+ );
- $text = $this->parse_block_elements($lines);
+ $Block['element']['text'] []= & $Block['li'];
- $text = rtrim($text, "\n");
+ return $Block;
+ }
- return $text;
- }
+ if ( ! isset($Block['interrupted']))
+ {
+ $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
- #
- # Private Methods
- #
+ $Block['li']['text'] []= $text;
- private function parse_block_elements(array $lines, $context = '')
- {
- $elements = array();
+ return $Block;
+ }
- $element = array(
- 'type' => '',
- );
+ if ($Line['indent'] > 0)
+ {
+ $Block['li']['text'] []= '';
- foreach ($lines as $line)
- {
- # fenced elements
+ $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
- switch ($element['type'])
- {
- case 'fenced block':
+ $Block['li']['text'] []= $text;
- if ( ! isset($element['closed']))
- {
- if (preg_match('/^[ ]*'.$element['fence'][0].'{3,}[ ]*$/', $line))
- {
- $element['closed'] = true;
- }
- else
- {
- $element['text'] !== '' and $element['text'] .= "\n";
+ unset($Block['interrupted']);
- $element['text'] .= $line;
- }
+ return $Block;
+ }
+ }
- continue 2;
- }
+ #
+ # Quote
- break;
+ protected function identifyQuote($Line)
+ {
+ if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
+ {
+ $Block = array(
+ 'element' => array(
+ 'name' => 'blockquote',
+ 'handler' => 'lines',
+ 'text' => (array) $matches[1],
+ ),
+ );
- case 'block-level markup':
+ return $Block;
+ }
+ }
- if ( ! isset($element['closed']))
- {
- if (strpos($line, $element['start']) !== false) # opening tag
- {
- $element['depth']++;
- }
+ protected function addToQuote($Line, array $Block)
+ {
+ if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
+ {
+ if (isset($Block['interrupted']))
+ {
+ $Block['element']['text'] []= '';
- if (strpos($line, $element['end']) !== false) # closing tag
- {
- $element['depth'] > 0
- ? $element['depth']--
- : $element['closed'] = true;
- }
+ unset($Block['interrupted']);
+ }
- $element['text'] .= "\n".$line;
+ $Block['element']['text'] []= $matches[1];
- continue 2;
- }
+ return $Block;
+ }
- break;
- }
+ if ( ! isset($Block['interrupted']))
+ {
+ $Block['element']['text'] []= $Line['text'];
- # *
+ return $Block;
+ }
+ }
- $deindented_line = ltrim($line);
+ #
+ # Table
- if ($deindented_line === '')
- {
- $element['interrupted'] = true;
+ protected function identifyTable($Line, array $Block = null)
+ {
+ if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted']))
+ {
+ return;
+ }
- continue;
- }
+ if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '')
+ {
+ $alignments = array();
- # composite elements
+ $divider = $Line['text'];
- switch ($element['type'])
- {
- case 'blockquote':
+ $divider = trim($divider);
+ $divider = trim($divider, '|');
- if ( ! isset($element['interrupted']))
- {
- $line = preg_replace('/^[ ]*>[ ]?/', '', $line);
+ $dividerCells = explode('|', $divider);
- $element['lines'] []= $line;
+ foreach ($dividerCells as $dividerCell)
+ {
+ $dividerCell = trim($dividerCell);
- continue 2;
- }
+ if ($dividerCell === '')
+ {
+ continue;
+ }
- break;
+ $alignment = null;
- case 'li':
+ if ($dividerCell[0] === ':')
+ {
+ $alignment = 'left';
+ }
- if (preg_match('/^([ ]{0,3})(\d+[.]|[*+-])[ ](.*)/', $line, $matches))
- {
- if ($element['indentation'] !== $matches[1])
- {
- $element['lines'] []= $line;
- }
- else
- {
- unset($element['last']);
+ if (substr($dividerCell, -1) === ':')
+ {
+ $alignment = $alignment === 'left' ? 'center' : 'right';
+ }
- $elements []= $element;
+ $alignments []= $alignment;
+ }
- $element = array(
- 'type' => 'li',
- 'indentation' => $matches[1],
- 'last' => true,
- 'lines' => array(
- preg_replace('/^[ ]{0,4}/', '', $matches[3]),
- ),
- );
- }
+ # ~
- continue 2;
- }
+ $HeaderElements = array();
- if (isset($element['interrupted']))
- {
- if ($line[0] === ' ')
- {
- $element['lines'] []= '';
+ $header = $Block['element']['text'];
- $line = preg_replace('/^[ ]{0,4}/', '', $line);
+ $header = trim($header);
+ $header = trim($header, '|');
+
+ $headerCells = explode('|', $header);
+
+ foreach ($headerCells as $index => $headerCell)
+ {
+ $headerCell = trim($headerCell);
+
+ $HeaderElement = array(
+ 'name' => 'th',
+ 'text' => $headerCell,
+ 'handler' => 'line',
+ );
+
+ if (isset($alignments[$index]))
+ {
+ $alignment = $alignments[$index];
+
+ $HeaderElement['attributes'] = array(
+ 'align' => $alignment,
+ );
+ }
+
+ $HeaderElements []= $HeaderElement;
+ }
+
+ # ~
+
+ $Block = array(
+ 'alignments' => $alignments,
+ 'identified' => true,
+ 'element' => array(
+ 'name' => 'table',
+ 'handler' => 'elements',
+ ),
+ );
+
+ $Block['element']['text'] []= array(
+ 'name' => 'thead',
+ 'handler' => 'elements',
+ );
+
+ $Block['element']['text'] []= array(
+ 'name' => 'tbody',
+ 'handler' => 'elements',
+ 'text' => array(),
+ );
- $element['lines'] []= $line;
+ $Block['element']['text'][0]['text'] []= array(
+ 'name' => 'tr',
+ 'handler' => 'elements',
+ 'text' => $HeaderElements,
+ );
- unset($element['interrupted']);
+ return $Block;
+ }
+ }
- continue 2;
- }
- }
- else
- {
- $line = preg_replace('/^[ ]{0,4}/', '', $line);
+ protected function addToTable($Line, array $Block)
+ {
+ if ($Line['text'][0] === '|' or strpos($Line['text'], '|'))
+ {
+ $Elements = array();
- $element['lines'] []= $line;
+ $row = $Line['text'];
- continue 2;
- }
+ $row = trim($row);
+ $row = trim($row, '|');
- break;
- }
+ $cells = explode('|', $row);
+
+ foreach ($cells as $index => $cell)
+ {
+ $cell = trim($cell);
+
+ $Element = array(
+ 'name' => 'td',
+ 'handler' => 'line',
+ 'text' => $cell,
+ );
+
+ if (isset($Block['alignments'][$index]))
+ {
+ $Element['attributes'] = array(
+ 'align' => $Block['alignments'][$index],
+ );
+ }
+
+ $Elements []= $Element;
+ }
+
+ $Element = array(
+ 'name' => 'tr',
+ 'handler' => 'elements',
+ 'text' => $Elements,
+ );
+
+ $Block['element']['text'][1]['text'] []= $Element;
+
+ return $Block;
+ }
+ }
+
+ #
+ # Code
+
+ protected function identifyCodeBlock($Line)
+ {
+ if ($Line['indent'] >= 4)
+ {
+ $text = substr($Line['body'], 4);
+
+ $Block = array(
+ 'element' => array(
+ 'name' => 'pre',
+ 'handler' => 'element',
+ 'text' => array(
+ 'name' => 'code',
+ 'text' => $text,
+ ),
+ ),
+ );
+
+ return $Block;
+ }
+ }
+
+ protected function addToCodeBlock($Line, $Block)
+ {
+ if ($Line['indent'] >= 4)
+ {
+ if (isset($Block['interrupted']))
+ {
+ $Block['element']['text']['text'] .= "\n";
+
+ unset($Block['interrupted']);
+ }
+
+ $Block['element']['text']['text'] .= "\n";
+
+ $text = substr($Line['body'], 4);
+
+ $Block['element']['text']['text'] .= $text;
+
+ return $Block;
+ }
+ }
+
+ protected function completeCodeBlock($Block)
+ {
+ $text = $Block['element']['text']['text'];
+
+ $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
+
+ $Block['element']['text']['text'] = $text;
+
+ return $Block;
+ }
+
+ #
+ # ~
+ #
+
+ private function element(array $Element)
+ {
+ $markup = '<'.$Element['name'];
+
+ if (isset($Element['attributes']))
+ {
+ foreach ($Element['attributes'] as $name => $value)
+ {
+ $markup .= ' '.$name.'="'.$value.'"';
+ }
+ }
+
+ if (isset($Element['text']))
+ {
+ $markup .= '>';
+
+ if (isset($Element['handler']))
+ {
+ $markup .= $this->$Element['handler']($Element['text']);
+ }
+ else
+ {
+ $markup .= $Element['text'];
+ }
- # indentation sensitive types
+ $markup .= ''.$Element['name'].'>';
+ }
+ else
+ {
+ $markup .= ' />';
+ }
- switch ($line[0])
- {
- case ' ':
+ return $markup;
+ }
- # code block
+ private function elements(array $Elements)
+ {
+ $markup = '';
- if (isset($line[3]) and $line[3] === ' ' and $line[2] === ' ' and $line[1] === ' ')
- {
- $code_line = substr($line, 4);
+ foreach ($Elements as $Element)
+ {
+ if ($Element === null)
+ {
+ continue;
+ }
- if ($element['type'] === 'code block')
- {
- if (isset($element['interrupted']))
- {
- $element['text'] .= "\n";
+ $markup .= "\n";
- unset ($element['interrupted']);
- }
+ if (is_string($Element)) # because of markup
+ {
+ $markup .= $Element;
- $element['text'] .= "\n".$code_line;
- }
- else
- {
- $elements []= $element;
+ continue;
+ }
- $element = array(
- 'type' => 'code block',
- 'text' => $code_line,
- );
- }
+ $markup .= $this->element($Element);
+ }
- continue 2;
- }
+ $markup .= "\n";
- break;
+ return $markup;
+ }
- case '#':
+ #
+ # Spans
+ #
- # atx heading (#)
+ protected $spanMarkers = array(
+ '!' => array('Link'), # ?
+ '&' => array('Ampersand'),
+ '*' => array('Emphasis'),
+ '/' => array('Url'),
+ '<' => array('UrlTag', 'EmailTag', 'Tag', 'LessThan'),
+ '[' => array('Link'),
+ '_' => array('Emphasis'),
+ '`' => array('InlineCode'),
+ '~' => array('Strikethrough'),
+ '\\' => array('EscapeSequence'),
+ );
- if (isset($line[1]))
- {
- $elements []= $element;
+ protected $spanMarkerList = '*_!&[`~\\';
- $level = 1;
+ public function line($text)
+ {
+ $markup = '';
- while (isset($line[$level]) and $line[$level] === '#')
- {
- $level++;
- }
+ $remainder = $text;
- $element = array(
- 'type' => 'heading',
- 'text' => trim($line, '# '),
- 'level' => $level,
- );
-
- continue 2;
- }
-
- break;
-
- case '-':
- case '=':
-
- # setext heading
-
- if ($element['type'] === 'paragraph' and isset($element['interrupted']) === false)
- {
- $chopped_line = rtrim($line);
-
- $i = 1;
-
- while (isset($chopped_line[$i]))
- {
- if ($chopped_line[$i] !== $line[0])
- {
- break 2;
- }
-
- $i++;
- }
-
- $element['type'] = 'heading';
- $element['level'] = $line[0] === '-' ? 2 : 1;
-
- continue 2;
- }
-
- break;
- }
-
- # indentation insensitive types
-
- switch ($deindented_line[0])
- {
- case '<':
-
- $position = strpos($deindented_line, '>');
-
- if ($position > 1) # tag
- {
- $name = substr($deindented_line, 1, $position - 1);
- $name = rtrim($name);
-
- if (substr($name, -1) === '/')
- {
- $self_closing = true;
-
- $name = substr($name, 0, -1);
- }
-
- $position = strpos($name, ' ');
-
- if ($position)
- {
- $name = substr($name, 0, $position);
- }
-
- if ( ! ctype_alpha($name))
- {
- break;
- }
-
- if (in_array($name, $this->inline_tags))
- {
- break;
- }
-
- $elements []= $element;
-
- if (isset($self_closing))
- {
- $element = array(
- 'type' => 'self-closing tag',
- 'text' => $deindented_line,
- );
-
- unset($self_closing);
-
- continue 2;
- }
-
- $element = array(
- 'type' => 'block-level markup',
- 'text' => $deindented_line,
- 'start' => '<'.$name.'>',
- 'end' => ''.$name.'>',
- 'depth' => 0,
- );
-
- if (strpos($deindented_line, $element['end']))
- {
- $element['closed'] = true;
- }
-
- continue 2;
- }
-
- break;
-
- case '>':
-
- # quote
-
- if (preg_match('/^>[ ]?(.*)/', $deindented_line, $matches))
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'blockquote',
- 'lines' => array(
- $matches[1],
- ),
- );
-
- continue 2;
- }
-
- break;
-
- case '[':
-
- # reference
-
- if (preg_match('/^\[(.+?)\]:[ ]*(.+?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*$/', $deindented_line, $matches))
- {
- $label = strtolower($matches[1]);
-
- $this->reference_map[$label] = array(
- '»' => trim($matches[2], '<>'),
- );
-
- if (isset($matches[3]))
- {
- $this->reference_map[$label]['#'] = $matches[3];
- }
-
- continue 2;
- }
-
- break;
-
- case '`':
- case '~':
-
- # fenced code block
-
- if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\S+)?[ ]*$/', $deindented_line, $matches))
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'fenced block',
- 'text' => '',
- 'fence' => $matches[1],
- );
-
- isset($matches[2]) and $element['language'] = $matches[2];
-
- continue 2;
- }
-
- break;
-
- case '*':
- case '+':
- case '-':
- case '_':
-
- # hr
-
- if (preg_match('/^([-*_])([ ]{0,2}\1){2,}[ ]*$/', $deindented_line))
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'hr',
- );
-
- continue 2;
- }
-
- # li
-
- if (preg_match('/^([ ]*)[*+-][ ](.*)/', $line, $matches))
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'li',
- 'ordered' => false,
- 'indentation' => $matches[1],
- 'last' => true,
- 'lines' => array(
- preg_replace('/^[ ]{0,4}/', '', $matches[2]),
- ),
- );
-
- continue 2;
- }
- }
-
- # li
-
- if ($deindented_line[0] <= '9' and $deindented_line[0] >= '0' and preg_match('/^([ ]*)\d+[.][ ](.*)/', $line, $matches))
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'li',
- 'ordered' => true,
- 'indentation' => $matches[1],
- 'last' => true,
- 'lines' => array(
- preg_replace('/^[ ]{0,4}/', '', $matches[2]),
- ),
- );
-
- continue;
- }
-
- # paragraph
-
- if ($element['type'] === 'paragraph')
- {
- if (isset($element['interrupted']))
- {
- $elements []= $element;
-
- $element['text'] = $line;
-
- unset($element['interrupted']);
- }
- else
- {
- $this->breaks_enabled and $element['text'] .= ' ';
-
- $element['text'] .= "\n".$line;
- }
- }
- else
- {
- $elements []= $element;
-
- $element = array(
- 'type' => 'paragraph',
- 'text' => $line,
- );
- }
- }
-
- $elements []= $element;
-
- unset($elements[0]);
-
- #
- # ~
- #
-
- $markup = '';
-
- foreach ($elements as $element)
- {
- switch ($element['type'])
- {
- case 'paragraph':
-
- $text = $this->parse_span_elements($element['text']);
-
- if ($context === 'li' and $markup === '')
- {
- if (isset($element['interrupted']))
- {
- $markup .= "\n".''.$text.'
'."\n"; - } - else - { - $markup .= $text; - } - } - else - { - $markup .= ''.$text.'
'."\n"; - } - - break; - - case 'blockquote': - - $text = $this->parse_block_elements($element['lines']); - - $markup .= ''."\n".$text.''."\n"; - - break; - - case 'code block': - - $text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8'); - - $markup .= '
'.$text.'
'."\n";
-
- break;
-
- case 'fenced block':
-
- $text = htmlspecialchars($element['text'], ENT_NOQUOTES, 'UTF-8');
-
- $markup .= '
'."\n";
-
- break;
-
- case 'heading':
-
- $text = $this->parse_span_elements($element['text']);
-
- $markup .= ''.$element_text.'
';
-
- $offset = strlen($matches[0]);
- }
- else
- {
- $markup .= '`';
-
- $offset = 1;
- }
-
- break;
-
- case 'http':
-
- if (preg_match('/^https?:[\/]{2}[^\s]+\b/i', $text, $matches))
- {
- $element_url = $matches[0];
- $element_url = str_replace('&', '&', $element_url);
- $element_url = str_replace('<', '<', $element_url);
-
- $markup .= ''.$element_url.'';
-
- $offset = strlen($matches[0]);
- }
- else
- {
- $markup .= 'http';
-
- $offset = 4;
- }
-
- break;
-
- case '~~':
-
- if (preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $text, $matches))
- {
- $matches[1] = $this->parse_span_elements($matches[1], $markers);
-
- $markup .= '') + { + $markup = $trimmedMarkup; + $markup = substr($markup, 3); + + $position = strpos($markup, "
"); + + $markup = substr_replace($markup, '', $position, 4); + } + + return $markup; + } + + # + # Multiton + # + + static function instance($name = 'default') + { + if (isset(self::$instances[$name])) + { + return self::$instances[$name]; + } + + $instance = new self(); + + self::$instances[$name] = $instance; + + return $instance; + } + + private static $instances = array(); + + # + # Deprecated Methods + # + + /** + * @deprecated in favor of "text" + */ + function parse($text) + { + $markup = $this->text($text); + + return $markup; + } + + # + # Fields + # + + protected $definitions; + + # + # Read-only + + protected $specialCharacters = array( + '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', + ); + + protected $strongRegex = array( + '*' => '/^[*]{2}((?:[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s', + '_' => '/^__((?:[^_]|_[^_]*_)+?)__(?!_)/us', + ); + + protected $emRegex = array( + '*' => '/^[*]((?:[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', + '_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us', + ); + + protected $textLevelElements = array( + 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', + 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', + 'i', 'rp', 'del', 'code', 'strike', 'marquee', + 'q', 'rt', 'ins', 'font', 'strong', + 's', 'tt', 'sub', 'mark', + 'u', 'xm', 'sup', 'nobr', + 'var', 'ruby', + 'wbr', 'span', + 'time', + ); +} diff --git a/library/vendor/Parsedown/README.md b/library/vendor/Parsedown/README.md deleted file mode 100644 index 29f77f59c..000000000 --- a/library/vendor/Parsedown/README.md +++ /dev/null @@ -1,31 +0,0 @@ -## Parsedown - -Better [Markdown](http://en.wikipedia.org/wiki/Markdown) parser for PHP. - -*** - -[ [demo](http://parsedown.org/demo) ] [ [tests](http://parsedown.org/tests/) ] - -*** - -### Features - -* [fast](http://parsedown.org/speed) -* [consistent](http://parsedown.org/consistency) -* [GitHub Flavored](https://help.github.com/articles/github-flavored-markdown) -* friendly to international input -* [tested](https://travis-ci.org/erusev/parsedown) in PHP 5.2, 5.3, 5.4, 5.5 and [hhvm](http://www.hhvm.com/) - -### Installation - -Include `Parsedown.php` or install [the composer package](https://packagist.org/packages/erusev/parsedown). - -### Example - -```php -$text = 'Hello _Parsedown_!'; - -$result = Parsedown::instance()->parse($text); - -echo $result; # prints:Hello Parsedown!
-``` diff --git a/library/vendor/Parsedown/SOURCE b/library/vendor/Parsedown/SOURCE new file mode 100644 index 000000000..59f79409d --- /dev/null +++ b/library/vendor/Parsedown/SOURCE @@ -0,0 +1,6 @@ +RELEASE=1.0.0-rc.4 +FILENAME=parsedown-$RELEASE +DESTINATION=. +wget -O ${FILENAME}.tar.gz https://github.com/erusev/parsedown/archive/${RELEASE}.tar.gz +tar xfz ${FILENAME}.tar.gz -C $DESTINATION/ --strip-components 1 $FILENAME/Parsedown.php $FILENAME/LICENSE.txt +chmod 644 $DESTINATION/Parsedown.php diff --git a/library/vendor/Parsedown/VERSION.txt b/library/vendor/Parsedown/VERSION.txt deleted file mode 100644 index ee94dd834..000000000 --- a/library/vendor/Parsedown/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -0.8.3 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php deleted file mode 100644 index 292c040d4..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php +++ /dev/null @@ -1,21 +0,0 @@ - 1.0) $result = '1'; - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php deleted file mode 100644 index 6599c5b2d..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php +++ /dev/null @@ -1,28 +0,0 @@ -def = $def; - $this->element = $element; - } - /** - * Checks if CurrentToken is set and equal to $this->element - */ - public function validate($string, $config, $context) { - $token = $context->get('CurrentToken', true); - if ($token && $token->name == $this->element) return false; - return $this->def->validate($string, $config, $context); - } -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Ident.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Ident.php deleted file mode 100644 index 779794a0b..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Ident.php +++ /dev/null @@ -1,24 +0,0 @@ -min = $min !== null ? HTMLPurifier_Length::make($min) : null; - $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - - // Optimizations - if ($string === '') return false; - if ($string === '0') return '0'; - if (strlen($string) === 1) return false; - - $length = HTMLPurifier_Length::make($string); - if (!$length->isValid()) return false; - - if ($this->min) { - $c = $length->compareTo($this->min); - if ($c === false) return false; - if ($c < 0) return false; - } - if ($this->max) { - $c = $length->compareTo($this->max); - if ($c === false) return false; - if ($c > 0) return false; - } - - return $length->toString(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/ListStyle.php deleted file mode 100644 index 4406868c0..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ /dev/null @@ -1,78 +0,0 @@ -getCSSDefinition(); - $this->info['list-style-type'] = $def->info['list-style-type']; - $this->info['list-style-position'] = $def->info['list-style-position']; - $this->info['list-style-image'] = $def->info['list-style-image']; - } - - public function validate($string, $config, $context) { - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['type'] = false; - $caught['position'] = false; - $caught['image'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($i >= 3) return; // optimization bit - if ($bit === '') continue; - foreach ($caught as $key => $status) { - if ($status !== false) continue; - $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); - if ($r === false) continue; - if ($r === 'none') { - if ($none) continue; - else $none = true; - if ($key == 'image') continue; - } - $caught[$key] = $r; - $i++; - break; - } - } - - if (!$i) return false; - - $ret = array(); - - // construct type - if ($caught['type']) $ret[] = $caught['type']; - - // construct image - if ($caught['image']) $ret[] = $caught['image']; - - // construct position - if ($caught['position']) $ret[] = $caught['position']; - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Percentage.php deleted file mode 100644 index c34b8fc3c..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/CSS/Percentage.php +++ /dev/null @@ -1,40 +0,0 @@ -number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); - } - - public function validate($string, $config, $context) { - - $string = $this->parseCDATA($string); - - if ($string === '') return false; - $length = strlen($string); - if ($length === 1) return false; - if ($string[$length - 1] !== '%') return false; - - $number = substr($string, 0, $length - 1); - $number = $this->number_def->validate($number, $config, $context); - - if ($number === false) return false; - return "$number%"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/Clone.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/Clone.php deleted file mode 100644 index ce68dbd54..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/Clone.php +++ /dev/null @@ -1,28 +0,0 @@ -clone = $clone; - } - - public function validate($v, $config, $context) { - return $this->clone->validate($v, $config, $context); - } - - public function make($string) { - return clone $this->clone; - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Bool.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Bool.php deleted file mode 100644 index e06987eb8..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Bool.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name;} - - public function validate($string, $config, $context) { - if (empty($string)) return false; - return $this->name; - } - - /** - * @param $string Name of attribute - */ - public function make($string) { - return new HTMLPurifier_AttrDef_HTML_Bool($string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Color.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Color.php deleted file mode 100644 index e02abb075..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Color.php +++ /dev/null @@ -1,33 +0,0 @@ -get('Core.ColorKeywords'); - - $string = trim($string); - - if (empty($string)) return false; - $lower = strtolower($string); - if (isset($colors[$lower])) return $colors[$lower]; - if ($string[0] === '#') $hex = substr($string, 1); - else $hex = $string; - - $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; - - return "#$hex"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php deleted file mode 100644 index ae6ea7c01..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ /dev/null @@ -1,21 +0,0 @@ -valid_values === false) $this->valid_values = $config->get('Attr.AllowedFrameTargets'); - return parent::validate($string, $config, $context); - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Length.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Length.php deleted file mode 100644 index a242f9c23..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/Length.php +++ /dev/null @@ -1,41 +0,0 @@ - 100) return '100%'; - - return ((string) $points) . '%'; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/MultiLength.php b/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/MultiLength.php deleted file mode 100644 index c72fc76e4..000000000 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/AttrDef/HTML/MultiLength.php +++ /dev/null @@ -1,41 +0,0 @@ -max = $max; - } - - public function validate($string, $config, $context) { - - $string = trim($string); - if ($string === '0') return $string; - if ($string === '') return false; - $length = strlen($string); - if (substr($string, $length - 2) == 'px') { - $string = substr($string, 0, $length - 2); - } - if (!is_numeric($string)) return false; - $int = (int) $string; - - if ($int < 0) return '0'; - - // upper-bound value, extremely high values can - // crash operating systems, see+ By RFC 1123, underscores are not permitted in host names. + (This is in contrast to the specification for DNS, RFC + 2181, which allows underscores.) + However, most browsers do the right thing when faced with + an underscore in the host name, and so some poorly written + websites are written with the expectation this should work. + Setting this parameter to true relaxes our allowed character + check so that underscores are permitted. +
+--# vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt similarity index 62% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt index 4d5b5055c..a3881be75 100644 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt @@ -2,9 +2,11 @@ Core.EscapeInvalidChildren TYPE: bool DEFAULT: false --DESCRIPTION-- -When true, a child is found that is not allowed in the context of the +Warning: this configuration option is no longer does anything as of 4.6.0.
+ +When true, a child is found that is not allowed in the context of the parent element will be transformed into text as if it were ASCII. When false, that element and all internal tags will be dropped, though text will be preserved. There is no option for dropping the element but preserving -child nodes. +child nodes.
--# vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt similarity index 93% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt index 0d00f62ea..1e17c1d46 100644 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt @@ -11,7 +11,7 @@ DEFAULT: NULL to check if a URI has passed through HTML Purifier with this line: -$checksum === sha1($secret_key . ':' . $url)+
$checksum === hash_hmac("sha256", $url, $secret_key)
If the output is TRUE, the redirector script should accept the URI.
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/info.ini b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/info.ini
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ConfigSchema/schema/info.ini
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ConfigSchema/schema/info.ini
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ContentSets.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ContentSets.php
similarity index 76%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ContentSets.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ContentSets.php
index 3b6e96f5f..543e3f8f1 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ContentSets.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ContentSets.php
@@ -7,35 +7,42 @@ class HTMLPurifier_ContentSets
{
/**
- * List of content set strings (pipe seperators) indexed by name.
+ * List of content set strings (pipe separators) indexed by name.
+ * @type array
*/
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 = array();
/**
- * Synchronized list of defined content sets (keys of info)
+ * Synchronized list of defined content sets (keys of info).
+ * @type array
*/
protected $keys = array();
/**
- * Synchronized list of defined content values (values of info)
+ * Synchronized list of defined content values (values of info).
+ * @type array
*/
protected $values = array();
/**
* Merges in module's content sets, expands identifiers in the content
* sets and populates the keys, values and lookup member variables.
- * @param $modules List of HTMLPurifier_HTMLModule
+ * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule
*/
- public function __construct($modules) {
- if (!is_array($modules)) $modules = array($modules);
+ public function __construct($modules)
+ {
+ if (!is_array($modules)) {
+ $modules = array($modules);
+ }
// populate content_sets based on module hints
// sorry, no way of overloading
- foreach ($modules as $module_i => $module) {
+ foreach ($modules as $module) {
foreach ($module->content_sets as $key => $value) {
$temp = $this->convertToLookup($value);
if (isset($this->lookup[$key])) {
@@ -70,11 +77,14 @@ class HTMLPurifier_ContentSets
/**
* Accepts a definition; generates and assigns a ChildDef for it
- * @param $def HTMLPurifier_ElementDef reference
- * @param $module Module that defined the ElementDef
+ * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference
+ * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef
*/
- public function generateChildDef(&$def, $module) {
- if (!empty($def->child)) return; // already done!
+ public function generateChildDef(&$def, $module)
+ {
+ if (!empty($def->child)) { // already done!
+ return;
+ }
$content_model = $def->content_model;
if (is_string($content_model)) {
// Assume that $this->keys is alphanumeric
@@ -89,7 +99,8 @@ class HTMLPurifier_ContentSets
$def->child = $this->getChildDef($def, $module);
}
- public function generateChildDefCallback($matches) {
+ public function generateChildDefCallback($matches)
+ {
return $this->info[$matches[0]];
}
@@ -98,10 +109,12 @@ class HTMLPurifier_ContentSets
* member variables in HTMLPurifier_ElementDef
* @note This will also defer to modules for custom HTMLPurifier_ChildDef
* subclasses that need content set expansion
- * @param $def HTMLPurifier_ElementDef to have ChildDef extracted
+ * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted
+ * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef
* @return HTMLPurifier_ChildDef corresponding to ElementDef
*/
- public function getChildDef($def, $module) {
+ public function getChildDef($def, $module)
+ {
$value = $def->content_model;
if (is_object($value)) {
trigger_error(
@@ -126,7 +139,9 @@ class HTMLPurifier_ContentSets
if ($module->defines_child_def) { // save a func call
$return = $module->getChildDef($def);
}
- if ($return !== false) return $return;
+ if ($return !== false) {
+ return $return;
+ }
// error-out
trigger_error(
'Could not determine which ChildDef class to instantiate',
@@ -138,18 +153,18 @@ class HTMLPurifier_ContentSets
/**
* Converts a string list of elements separated by pipes into
* a lookup array.
- * @param $string List of elements
- * @return Lookup array of elements
+ * @param string $string List of elements
+ * @return array Lookup array of elements
*/
- protected function convertToLookup($string) {
+ protected function convertToLookup($string)
+ {
$array = explode('|', str_replace(' ', '', $string));
$ret = array();
- foreach ($array as $i => $k) {
+ foreach ($array as $k) {
$ret[$k] = true;
}
return $ret;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Context.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Context.php
new file mode 100644
index 000000000..00e509c85
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Context.php
@@ -0,0 +1,95 @@
+_storage)) {
+ trigger_error(
+ "Name $name produces collision, cannot re-register",
+ E_USER_ERROR
+ );
+ return;
+ }
+ $this->_storage[$name] =& $ref;
+ }
+
+ /**
+ * Retrieves a variable reference from the context.
+ * @param string $name String name
+ * @param bool $ignore_error Boolean whether or not to ignore error
+ * @return mixed
+ */
+ public function &get($name, $ignore_error = false)
+ {
+ if (!array_key_exists($name, $this->_storage)) {
+ if (!$ignore_error) {
+ trigger_error(
+ "Attempted to retrieve non-existent variable $name",
+ E_USER_ERROR
+ );
+ }
+ $var = null; // so we can return by reference
+ return $var;
+ }
+ return $this->_storage[$name];
+ }
+
+ /**
+ * Destroys a variable in the context.
+ * @param string $name String name
+ */
+ public function destroy($name)
+ {
+ if (!array_key_exists($name, $this->_storage)) {
+ trigger_error(
+ "Attempted to destroy non-existent variable $name",
+ E_USER_ERROR
+ );
+ return;
+ }
+ unset($this->_storage[$name]);
+ }
+
+ /**
+ * Checks whether or not the variable exists.
+ * @param string $name String name
+ * @return bool
+ */
+ public function exists($name)
+ {
+ return array_key_exists($name, $this->_storage);
+ }
+
+ /**
+ * Loads a series of variables from an associative array
+ * @param array $context_array Assoc array of variables to load
+ */
+ public function loadArray($context_array)
+ {
+ foreach ($context_array as $key => $discard) {
+ $this->register($key, $context_array[$key]);
+ }
+ }
+}
+
+// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Definition.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Definition.php
similarity index 82%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Definition.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Definition.php
index c7f82eba4..bc6d43364 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Definition.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Definition.php
@@ -9,6 +9,7 @@ abstract class HTMLPurifier_Definition
/**
* Has setup() been called yet?
+ * @type bool
*/
public $setup = false;
@@ -20,31 +21,35 @@ abstract class HTMLPurifier_Definition
* is used and any writes to the raw definition object are short
* circuited. See enduser-customize.html for the high-level
* picture.
+ * @type bool
*/
public $optimized = null;
/**
* What type of definition is it?
+ * @type string
*/
public $type;
/**
* Sets up the definition object into the final form, something
* not done by the constructor
- * @param $config HTMLPurifier_Config instance
+ * @param HTMLPurifier_Config $config
*/
abstract protected function doSetup($config);
/**
* Setup function that aborts if already setup
- * @param $config HTMLPurifier_Config instance
+ * @param HTMLPurifier_Config $config
*/
- public function setup($config) {
- if ($this->setup) return;
+ public function setup($config)
+ {
+ if ($this->setup) {
+ return;
+ }
$this->setup = true;
$this->doSetup($config);
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCache.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache.php
similarity index 66%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCache.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache.php
index c6e1e388c..67bb5b1e6 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCache.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache.php
@@ -10,22 +10,27 @@
*/
abstract class HTMLPurifier_DefinitionCache
{
-
+ /**
+ * @type string
+ */
public $type;
/**
- * @param $name Type of definition objects this instance of the
+ * @param string $type Type of definition objects this instance of the
* cache will handle.
*/
- public function __construct($type) {
+ public function __construct($type)
+ {
$this->type = $type;
}
/**
* Generates a unique identifier for a particular configuration
- * @param Instance of HTMLPurifier_Config
+ * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config
+ * @return string
*/
- public function generateKey($config) {
+ public function generateKey($config)
+ {
return $config->version . ',' . // possibly replace with function calls
$config->getBatchSerial($this->type) . ',' .
$config->get($this->type . '.DefinitionRev');
@@ -34,30 +39,37 @@ abstract class HTMLPurifier_DefinitionCache
/**
* Tests whether or not a key is old with respect to the configuration's
* version and revision number.
- * @param $key Key to test
- * @param $config Instance of HTMLPurifier_Config to test against
+ * @param string $key Key to test
+ * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config to test against
+ * @return bool
*/
- public function isOld($key, $config) {
- if (substr_count($key, ',') < 2) return true;
+ public function isOld($key, $config)
+ {
+ if (substr_count($key, ',') < 2) {
+ return true;
+ }
list($version, $hash, $revision) = explode(',', $key, 3);
$compare = version_compare($version, $config->version);
// version mismatch, is always old
- if ($compare != 0) return true;
+ if ($compare != 0) {
+ return true;
+ }
// versions match, ids match, check revision number
- if (
- $hash == $config->getBatchSerial($this->type) &&
- $revision < $config->get($this->type . '.DefinitionRev')
- ) return true;
+ if ($hash == $config->getBatchSerial($this->type) &&
+ $revision < $config->get($this->type . '.DefinitionRev')) {
+ return true;
+ }
return false;
}
/**
* Checks if a definition's type jives with the cache's type
* @note Throws an error on failure
- * @param $def Definition object to check
- * @return Boolean true if good, false if not
+ * @param HTMLPurifier_Definition $def Definition object to check
+ * @return bool true if good, false if not
*/
- public function checkDefType($def) {
+ public function checkDefType($def)
+ {
if ($def->type !== $this->type) {
trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}");
return false;
@@ -67,31 +79,40 @@ abstract class HTMLPurifier_DefinitionCache
/**
* Adds a definition object to the cache
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
*/
abstract public function add($def, $config);
/**
* Unconditionally saves a definition object to the cache
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
*/
abstract public function set($def, $config);
/**
* Replace an object in the cache
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
*/
abstract public function replace($def, $config);
/**
* Retrieves a definition object from the cache
+ * @param HTMLPurifier_Config $config
*/
abstract public function get($config);
/**
* Removes a definition object to the cache
+ * @param HTMLPurifier_Config $config
*/
abstract public function remove($config);
/**
* Clears all objects from cache
+ * @param HTMLPurifier_Config $config
*/
abstract public function flush($config);
@@ -100,9 +121,9 @@ abstract class HTMLPurifier_DefinitionCache
* @note Be carefuly implementing this method as flush. Flush must
* not interfere with other Definition types, and cleanup()
* should not be repeatedly called by userland code.
+ * @param HTMLPurifier_Config $config
*/
abstract public function cleanup($config);
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator.php
new file mode 100644
index 000000000..b57a51b6c
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator.php
@@ -0,0 +1,112 @@
+copy();
+ // reference is necessary for mocks in PHP 4
+ $decorator->cache =& $cache;
+ $decorator->type = $cache->type;
+ return $decorator;
+ }
+
+ /**
+ * Cross-compatible clone substitute
+ * @return HTMLPurifier_DefinitionCache_Decorator
+ */
+ public function copy()
+ {
+ return new HTMLPurifier_DefinitionCache_Decorator();
+ }
+
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function add($def, $config)
+ {
+ return $this->cache->add($def, $config);
+ }
+
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function set($def, $config)
+ {
+ return $this->cache->set($def, $config);
+ }
+
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function replace($def, $config)
+ {
+ return $this->cache->replace($def, $config);
+ }
+
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function get($config)
+ {
+ return $this->cache->get($config);
+ }
+
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function remove($config)
+ {
+ return $this->cache->remove($config);
+ }
+
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function flush($config)
+ {
+ return $this->cache->flush($config);
+ }
+
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function cleanup($config)
+ {
+ return $this->cache->cleanup($config);
+ }
+}
+
+// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php
new file mode 100644
index 000000000..4991777ce
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php
@@ -0,0 +1,78 @@
+definitions[$this->generateKey($config)] = $def;
+ }
+ return $status;
+ }
+
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function set($def, $config)
+ {
+ $status = parent::set($def, $config);
+ if ($status) {
+ $this->definitions[$this->generateKey($config)] = $def;
+ }
+ return $status;
+ }
+
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function replace($def, $config)
+ {
+ $status = parent::replace($def, $config);
+ if ($status) {
+ $this->definitions[$this->generateKey($config)] = $def;
+ }
+ return $status;
+ }
+
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return mixed
+ */
+ public function get($config)
+ {
+ $key = $this->generateKey($config);
+ if (isset($this->definitions[$key])) {
+ return $this->definitions[$key];
+ }
+ $this->definitions[$key] = parent::get($config);
+ return $this->definitions[$key];
+ }
+}
+
+// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in
new file mode 100644
index 000000000..b1fec8d36
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in
@@ -0,0 +1,82 @@
+checkDefType($def)) return;
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return int|bool
+ */
+ public function add($def, $config)
+ {
+ if (!$this->checkDefType($def)) {
+ return;
+ }
$file = $this->generateFilePath($config);
- if (file_exists($file)) return false;
- if (!$this->_prepareDir($config)) return false;
+ if (file_exists($file)) {
+ return false;
+ }
+ if (!$this->_prepareDir($config)) {
+ return false;
+ }
return $this->_write($file, serialize($def), $config);
}
- public function set($def, $config) {
- if (!$this->checkDefType($def)) return;
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return int|bool
+ */
+ public function set($def, $config)
+ {
+ if (!$this->checkDefType($def)) {
+ return;
+ }
$file = $this->generateFilePath($config);
- if (!$this->_prepareDir($config)) return false;
+ if (!$this->_prepareDir($config)) {
+ return false;
+ }
return $this->_write($file, serialize($def), $config);
}
- public function replace($def, $config) {
- if (!$this->checkDefType($def)) return;
+ /**
+ * @param HTMLPurifier_Definition $def
+ * @param HTMLPurifier_Config $config
+ * @return int|bool
+ */
+ public function replace($def, $config)
+ {
+ if (!$this->checkDefType($def)) {
+ return;
+ }
$file = $this->generateFilePath($config);
- if (!file_exists($file)) return false;
- if (!$this->_prepareDir($config)) return false;
+ if (!file_exists($file)) {
+ return false;
+ }
+ if (!$this->_prepareDir($config)) {
+ return false;
+ }
return $this->_write($file, serialize($def), $config);
}
- public function get($config) {
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return bool|HTMLPurifier_Config
+ */
+ public function get($config)
+ {
$file = $this->generateFilePath($config);
- if (!file_exists($file)) return false;
+ if (!file_exists($file)) {
+ return false;
+ }
return unserialize(file_get_contents($file));
}
- public function remove($config) {
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return bool
+ */
+ public function remove($config)
+ {
$file = $this->generateFilePath($config);
- if (!file_exists($file)) return false;
+ if (!file_exists($file)) {
+ return false;
+ }
return unlink($file);
}
- public function flush($config) {
- if (!$this->_prepareDir($config)) return false;
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return bool
+ */
+ public function flush($config)
+ {
+ if (!$this->_prepareDir($config)) {
+ return false;
+ }
$dir = $this->generateDirectoryPath($config);
- $dh = opendir($dir);
+ $dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
- if (empty($filename)) continue;
- if ($filename[0] === '.') continue;
+ if (empty($filename)) {
+ continue;
+ }
+ if ($filename[0] === '.') {
+ continue;
+ }
unlink($dir . '/' . $filename);
}
}
- public function cleanup($config) {
- if (!$this->_prepareDir($config)) return false;
+ /**
+ * @param HTMLPurifier_Config $config
+ * @return bool
+ */
+ public function cleanup($config)
+ {
+ if (!$this->_prepareDir($config)) {
+ return false;
+ }
$dir = $this->generateDirectoryPath($config);
- $dh = opendir($dir);
+ $dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
- if (empty($filename)) continue;
- if ($filename[0] === '.') continue;
+ if (empty($filename)) {
+ continue;
+ }
+ if ($filename[0] === '.') {
+ continue;
+ }
$key = substr($filename, 0, strlen($filename) - 4);
- if ($this->isOld($key, $config)) unlink($dir . '/' . $filename);
+ if ($this->isOld($key, $config)) {
+ unlink($dir . '/' . $filename);
+ }
}
}
/**
* Generates the file path to the serial file corresponding to
* the configuration and definition name
+ * @param HTMLPurifier_Config $config
+ * @return string
* @todo Make protected
*/
- public function generateFilePath($config) {
+ public function generateFilePath($config)
+ {
$key = $this->generateKey($config);
return $this->generateDirectoryPath($config) . '/' . $key . '.ser';
}
/**
* Generates the path to the directory contain this cache's serial files
+ * @param HTMLPurifier_Config $config
+ * @return string
* @note No trailing slash
* @todo Make protected
*/
- public function generateDirectoryPath($config) {
+ public function generateDirectoryPath($config)
+ {
$base = $this->generateBaseDirectoryPath($config);
return $base . '/' . $this->type;
}
@@ -85,9 +162,12 @@ class HTMLPurifier_DefinitionCache_Serializer extends
/**
* Generates path to base directory that contains all definition type
* serials
+ * @param HTMLPurifier_Config $config
+ * @return mixed|string
* @todo Make protected
*/
- public function generateBaseDirectoryPath($config) {
+ public function generateBaseDirectoryPath($config)
+ {
$base = $config->get('Cache.SerializerPath');
$base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base;
return $base;
@@ -95,12 +175,13 @@ class HTMLPurifier_DefinitionCache_Serializer extends
/**
* Convenience wrapper function for file_put_contents
- * @param $file File name to write to
- * @param $data Data to write into file
- * @param $config Config object
- * @return Number of bytes written if success, or false if failure.
+ * @param string $file File name to write to
+ * @param string $data Data to write into file
+ * @param HTMLPurifier_Config $config
+ * @return int|bool Number of bytes written if success, or false if failure.
*/
- private function _write($file, $data, $config) {
+ private function _write($file, $data, $config)
+ {
$result = file_put_contents($file, $data);
if ($result !== false) {
// set permissions of the new file (no execute)
@@ -116,10 +197,11 @@ class HTMLPurifier_DefinitionCache_Serializer extends
/**
* Prepares the directory that this type stores the serials in
- * @param $config Config object
- * @return True if successful
+ * @param HTMLPurifier_Config $config
+ * @return bool True if successful
*/
- private function _prepareDir($config) {
+ private function _prepareDir($config)
+ {
$directory = $this->generateDirectoryPath($config);
$chmod = $config->get('Cache.SerializerPermissions');
if (!$chmod) {
@@ -128,9 +210,11 @@ class HTMLPurifier_DefinitionCache_Serializer extends
if (!is_dir($directory)) {
$base = $this->generateBaseDirectoryPath($config);
if (!is_dir($base)) {
- trigger_error('Base directory '.$base.' does not exist,
+ trigger_error(
+ 'Base directory ' . $base . ' does not exist,
please create or change using %Cache.SerializerPath',
- E_USER_WARNING);
+ E_USER_WARNING
+ );
return false;
} elseif (!$this->_testPermissions($base, $chmod)) {
return false;
@@ -147,18 +231,23 @@ class HTMLPurifier_DefinitionCache_Serializer extends
/**
* Tests permissions on a directory and throws out friendly
* error messages and attempts to chmod it itself if possible
- * @param $dir Directory path
- * @param $chmod Permissions
- * @return True if directory writable
+ * @param string $dir Directory path
+ * @param int $chmod Permissions
+ * @return bool True if directory is writable
*/
- private function _testPermissions($dir, $chmod) {
+ private function _testPermissions($dir, $chmod)
+ {
// early abort, if it is writable, everything is hunky-dory
- if (is_writable($dir)) return true;
+ if (is_writable($dir)) {
+ return true;
+ }
if (!is_dir($dir)) {
// generally, you'll want to handle this beforehand
// so a more specific error message can be given
- trigger_error('Directory '.$dir.' does not exist',
- E_USER_WARNING);
+ trigger_error(
+ 'Directory ' . $dir . ' does not exist',
+ E_USER_WARNING
+ );
return false;
}
if (function_exists('posix_getuid')) {
@@ -166,7 +255,9 @@ class HTMLPurifier_DefinitionCache_Serializer extends
if (fileowner($dir) === posix_getuid()) {
// we can chmod it ourselves
$chmod = $chmod | 0700;
- if (chmod($dir, $chmod)) return true;
+ if (chmod($dir, $chmod)) {
+ return true;
+ }
} elseif (filegroup($dir) === posix_getgid()) {
$chmod = $chmod | 0070;
} else {
@@ -174,18 +265,21 @@ class HTMLPurifier_DefinitionCache_Serializer extends
// need to give global permissions
$chmod = $chmod | 0777;
}
- trigger_error('Directory '.$dir.' not writable, '.
+ trigger_error(
+ 'Directory ' . $dir . ' not writable, ' .
'please chmod to ' . decoct($chmod),
- E_USER_WARNING);
+ E_USER_WARNING
+ );
} else {
// generic error message
- trigger_error('Directory '.$dir.' not writable, '.
+ trigger_error(
+ 'Directory ' . $dir . ' not writable, ' .
'please alter file permissions',
- E_USER_WARNING);
+ E_USER_WARNING
+ );
}
return false;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCache/Serializer/README b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Serializer/README
old mode 100644
new mode 100755
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCache/Serializer/README
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCache/Serializer/README
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php
similarity index 67%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php
index a6ead6281..fd1cc9be4 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DefinitionCacheFactory.php
@@ -5,22 +5,36 @@
*/
class HTMLPurifier_DefinitionCacheFactory
{
-
+ /**
+ * @type array
+ */
protected $caches = array('Serializer' => array());
+
+ /**
+ * @type array
+ */
protected $implementations = array();
+
+ /**
+ * @type HTMLPurifier_DefinitionCache_Decorator[]
+ */
protected $decorators = array();
/**
* Initialize default decorators
*/
- public function setup() {
+ public function setup()
+ {
$this->addDecorator('Cleanup');
}
/**
* Retrieves an instance of global definition cache factory.
+ * @param HTMLPurifier_DefinitionCacheFactory $prototype
+ * @return HTMLPurifier_DefinitionCacheFactory
*/
- public static function instance($prototype = null) {
+ public static function instance($prototype = null)
+ {
static $instance;
if ($prototype !== null) {
$instance = $prototype;
@@ -33,19 +47,22 @@ class HTMLPurifier_DefinitionCacheFactory
/**
* Registers a new definition cache object
- * @param $short Short name of cache object, for reference
- * @param $long Full class name of cache object, for construction
+ * @param string $short Short name of cache object, for reference
+ * @param string $long Full class name of cache object, for construction
*/
- public function register($short, $long) {
+ public function register($short, $long)
+ {
$this->implementations[$short] = $long;
}
/**
* Factory method that creates a cache object based on configuration
- * @param $name Name of definitions handled by cache
- * @param $config Instance of HTMLPurifier_Config
+ * @param string $type Name of definitions handled by cache
+ * @param HTMLPurifier_Config $config Config instance
+ * @return mixed
*/
- public function create($type, $config) {
+ public function create($type, $config)
+ {
$method = $config->get('Cache.DefinitionImpl');
if ($method === null) {
return new HTMLPurifier_DefinitionCache_Null($type);
@@ -53,10 +70,8 @@ class HTMLPurifier_DefinitionCacheFactory
if (!empty($this->caches[$method][$type])) {
return $this->caches[$method][$type];
}
- if (
- isset($this->implementations[$method]) &&
- class_exists($class = $this->implementations[$method], false)
- ) {
+ if (isset($this->implementations[$method]) &&
+ class_exists($class = $this->implementations[$method], false)) {
$cache = new $class($type);
} else {
if ($method != 'Serializer') {
@@ -76,16 +91,16 @@ class HTMLPurifier_DefinitionCacheFactory
/**
* Registers a decorator to add to all new cache objects
- * @param
+ * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator
*/
- public function addDecorator($decorator) {
+ public function addDecorator($decorator)
+ {
if (is_string($decorator)) {
$class = "HTMLPurifier_DefinitionCache_Decorator_$decorator";
$decorator = new $class;
}
$this->decorators[$decorator->name] = $decorator;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Doctype.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Doctype.php
similarity index 77%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Doctype.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Doctype.php
index 1e3c574c0..4acd06e5b 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Doctype.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Doctype.php
@@ -10,42 +10,55 @@ class HTMLPurifier_Doctype
{
/**
* Full name of doctype
+ * @type string
*/
public $name;
/**
* List of standard modules (string identifiers or literal objects)
* that this doctype uses
+ * @type array
*/
public $modules = array();
/**
* List of modules to use for tidying up code
+ * @type array
*/
public $tidyModules = array();
/**
* Is the language derived from XML (i.e. XHTML)?
+ * @type bool
*/
public $xml = true;
/**
* List of aliases for this doctype
+ * @type array
*/
public $aliases = array();
/**
* Public DTD identifier
+ * @type string
*/
public $dtdPublic;
/**
* System DTD identifier
+ * @type string
*/
public $dtdSystem;
- public function __construct($name = null, $xml = true, $modules = array(),
- $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null
+ public function __construct(
+ $name = null,
+ $xml = true,
+ $modules = array(),
+ $tidyModules = array(),
+ $aliases = array(),
+ $dtd_public = null,
+ $dtd_system = null
) {
$this->name = $name;
$this->xml = $xml;
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DoctypeRegistry.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DoctypeRegistry.php
similarity index 51%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DoctypeRegistry.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DoctypeRegistry.php
index 86049e939..acc1d64a6 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/DoctypeRegistry.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/DoctypeRegistry.php
@@ -4,12 +4,14 @@ class HTMLPurifier_DoctypeRegistry
{
/**
- * Hash of doctype names to doctype objects
+ * Hash of doctype names to doctype objects.
+ * @type array
*/
protected $doctypes;
/**
- * Lookup table of aliases to real doctype names
+ * Lookup table of aliases to real doctype names.
+ * @type array
*/
protected $aliases;
@@ -17,32 +19,57 @@ class HTMLPurifier_DoctypeRegistry
* Registers a doctype to the registry
* @note Accepts a fully-formed doctype object, or the
* parameters for constructing a doctype object
- * @param $doctype Name of doctype or literal doctype object
- * @param $modules Modules doctype will load
- * @param $modules_for_modes Modules doctype will load for certain modes
- * @param $aliases Alias names for doctype
- * @return Editable registered doctype
+ * @param string $doctype Name of doctype or literal doctype object
+ * @param bool $xml
+ * @param array $modules Modules doctype will load
+ * @param array $tidy_modules Modules doctype will load for certain modes
+ * @param array $aliases Alias names for doctype
+ * @param string $dtd_public
+ * @param string $dtd_system
+ * @return HTMLPurifier_Doctype Editable registered doctype
*/
- public function register($doctype, $xml = true, $modules = array(),
- $tidy_modules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null
+ public function register(
+ $doctype,
+ $xml = true,
+ $modules = array(),
+ $tidy_modules = array(),
+ $aliases = array(),
+ $dtd_public = null,
+ $dtd_system = null
) {
- if (!is_array($modules)) $modules = array($modules);
- if (!is_array($tidy_modules)) $tidy_modules = array($tidy_modules);
- if (!is_array($aliases)) $aliases = array($aliases);
+ if (!is_array($modules)) {
+ $modules = array($modules);
+ }
+ if (!is_array($tidy_modules)) {
+ $tidy_modules = array($tidy_modules);
+ }
+ if (!is_array($aliases)) {
+ $aliases = array($aliases);
+ }
if (!is_object($doctype)) {
$doctype = new HTMLPurifier_Doctype(
- $doctype, $xml, $modules, $tidy_modules, $aliases, $dtd_public, $dtd_system
+ $doctype,
+ $xml,
+ $modules,
+ $tidy_modules,
+ $aliases,
+ $dtd_public,
+ $dtd_system
);
}
$this->doctypes[$doctype->name] = $doctype;
$name = $doctype->name;
// hookup aliases
foreach ($doctype->aliases as $alias) {
- if (isset($this->doctypes[$alias])) continue;
+ if (isset($this->doctypes[$alias])) {
+ continue;
+ }
$this->aliases[$alias] = $name;
}
// remove old aliases
- if (isset($this->aliases[$name])) unset($this->aliases[$name]);
+ if (isset($this->aliases[$name])) {
+ unset($this->aliases[$name]);
+ }
return $doctype;
}
@@ -50,11 +77,14 @@ class HTMLPurifier_DoctypeRegistry
* Retrieves reference to a doctype of a certain name
* @note This function resolves aliases
* @note When possible, use the more fully-featured make()
- * @param $doctype Name of doctype
- * @return Editable doctype object
+ * @param string $doctype Name of doctype
+ * @return HTMLPurifier_Doctype Editable doctype object
*/
- public function get($doctype) {
- if (isset($this->aliases[$doctype])) $doctype = $this->aliases[$doctype];
+ public function get($doctype)
+ {
+ if (isset($this->aliases[$doctype])) {
+ $doctype = $this->aliases[$doctype];
+ }
if (!isset($this->doctypes[$doctype])) {
trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR);
$anon = new HTMLPurifier_Doctype($doctype);
@@ -70,20 +100,30 @@ class HTMLPurifier_DoctypeRegistry
* can hold on to (this is necessary in order to tell
* Generator whether or not the current document is XML
* based or not).
+ * @param HTMLPurifier_Config $config
+ * @return HTMLPurifier_Doctype
*/
- public function make($config) {
+ public function make($config)
+ {
return clone $this->get($this->getDoctypeFromConfig($config));
}
/**
* Retrieves the doctype from the configuration object
+ * @param HTMLPurifier_Config $config
+ * @return string
*/
- public function getDoctypeFromConfig($config) {
+ public function getDoctypeFromConfig($config)
+ {
// recommended test
$doctype = $config->get('HTML.Doctype');
- if (!empty($doctype)) return $doctype;
+ if (!empty($doctype)) {
+ return $doctype;
+ }
$doctype = $config->get('HTML.CustomDoctype');
- if (!empty($doctype)) return $doctype;
+ if (!empty($doctype)) {
+ return $doctype;
+ }
// backwards-compatibility
if ($config->get('HTML.XHTML')) {
$doctype = 'XHTML 1.0';
@@ -97,7 +137,6 @@ class HTMLPurifier_DoctypeRegistry
}
return $doctype;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ElementDef.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ElementDef.php
similarity index 83%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ElementDef.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ElementDef.php
index 10f7ab7f8..d5311cedc 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ElementDef.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ElementDef.php
@@ -10,15 +10,16 @@
*/
class HTMLPurifier_ElementDef
{
-
/**
* Does the definition work by itself, or is it created solely
* for the purpose of merging into another definition?
+ * @type bool
*/
public $standalone = true;
/**
- * Associative array of attribute name to HTMLPurifier_AttrDef
+ * Associative array of attribute name to HTMLPurifier_AttrDef.
+ * @type array
* @note Before being processed by HTMLPurifier_AttrCollections
* when modules are finalized during
* HTMLPurifier_HTMLDefinition->setup(), this array may also
@@ -43,26 +44,30 @@ class HTMLPurifier_ElementDef
// nuking.
/**
- * List of tags HTMLPurifier_AttrTransform to be done before validation
+ * List of tags HTMLPurifier_AttrTransform to be done before validation.
+ * @type array
*/
public $attr_transform_pre = array();
/**
- * List of tags HTMLPurifier_AttrTransform to be done after validation
+ * List of tags HTMLPurifier_AttrTransform to be done after validation.
+ * @type array
*/
public $attr_transform_post = array();
/**
* HTMLPurifier_ChildDef of this tag.
+ * @type HTMLPurifier_ChildDef
*/
public $child;
/**
- * Abstract string representation of internal ChildDef rules. See
- * HTMLPurifier_ContentSets for how this is parsed and then transformed
+ * Abstract string representation of internal ChildDef rules.
+ * @see HTMLPurifier_ContentSets for how this is parsed and then transformed
* into an HTMLPurifier_ChildDef.
* @warning This is a temporary variable that is not available after
* being processed by HTMLDefinition
+ * @type string
*/
public $content_model;
@@ -72,27 +77,29 @@ class HTMLPurifier_ElementDef
* @warning This must be lowercase
* @warning This is a temporary variable that is not available after
* being processed by HTMLDefinition
+ * @type string
*/
public $content_model_type;
-
-
/**
* Does the element have a content model (#PCDATA | Inline)*? This
* is important for chameleon ins and del processing in
* HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't
* have to worry about this one.
+ * @type bool
*/
public $descendants_are_inline = false;
/**
- * List of the names of required attributes this element has. Dynamically
- * populated by HTMLPurifier_HTMLDefinition::getElement
+ * List of the names of required attributes this element has.
+ * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement()
+ * @type array
*/
public $required_attr = array();
/**
* Lookup table of tags excluded from all descendants of this tag.
+ * @type array
* @note SGML permits exclusions for all descendants, but this is
* not possible with DTDs or XML Schemas. W3C has elected to
* use complicated compositions of content_models to simulate
@@ -106,6 +113,7 @@ class HTMLPurifier_ElementDef
/**
* This tag is explicitly auto-closed by the following tags.
+ * @type array
*/
public $autoclose = array();
@@ -113,19 +121,22 @@ class HTMLPurifier_ElementDef
* If a foreign element is found in this element, test if it is
* allowed by this sub-element; if it is, instead of closing the
* current element, place it inside this element.
+ * @type string
*/
public $wrap;
/**
* Whether or not this is a formatting element affected by the
* "Active Formatting Elements" algorithm.
+ * @type bool
*/
public $formatting;
/**
* Low-level factory constructor for creating new standalone element defs
*/
- public static function create($content_model, $content_model_type, $attr) {
+ public static function create($content_model, $content_model_type, $attr)
+ {
$def = new HTMLPurifier_ElementDef();
$def->content_model = $content_model;
$def->content_model_type = $content_model_type;
@@ -137,11 +148,12 @@ class HTMLPurifier_ElementDef
* Merges the values of another element definition into this one.
* Values from the new element def take precedence if a value is
* not mergeable.
+ * @param HTMLPurifier_ElementDef $def
*/
- public function mergeIn($def) {
-
+ public function mergeIn($def)
+ {
// later keys takes precedence
- foreach($def->attr as $k => $v) {
+ foreach ($def->attr as $k => $v) {
if ($k === 0) {
// merge in the includes
// sorry, no way to override an include
@@ -151,7 +163,9 @@ class HTMLPurifier_ElementDef
continue;
}
if ($v === false) {
- if (isset($this->attr[$k])) unset($this->attr[$k]);
+ if (isset($this->attr[$k])) {
+ unset($this->attr[$k]);
+ }
continue;
}
$this->attr[$k] = $v;
@@ -160,19 +174,24 @@ class HTMLPurifier_ElementDef
$this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre);
$this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post);
- if(!empty($def->content_model)) {
+ if (!empty($def->content_model)) {
$this->content_model =
str_replace("#SUPER", $this->content_model, $def->content_model);
$this->child = false;
}
- if(!empty($def->content_model_type)) {
+ if (!empty($def->content_model_type)) {
$this->content_model_type = $def->content_model_type;
$this->child = false;
}
- if(!is_null($def->child)) $this->child = $def->child;
- if(!is_null($def->formatting)) $this->formatting = $def->formatting;
- if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline;
-
+ if (!is_null($def->child)) {
+ $this->child = $def->child;
+ }
+ if (!is_null($def->formatting)) {
+ $this->formatting = $def->formatting;
+ }
+ if ($def->descendants_are_inline) {
+ $this->descendants_are_inline = $def->descendants_are_inline;
+ }
}
/**
@@ -180,16 +199,18 @@ class HTMLPurifier_ElementDef
* @param $a1 Array by reference that is merged into
* @param $a2 Array that merges into $a1
*/
- private function _mergeAssocArray(&$a1, $a2) {
+ private function _mergeAssocArray(&$a1, $a2)
+ {
foreach ($a2 as $k => $v) {
if ($v === false) {
- if (isset($a1[$k])) unset($a1[$k]);
+ if (isset($a1[$k])) {
+ unset($a1[$k]);
+ }
continue;
}
$a1[$k] = $v;
}
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Encoder.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Encoder.php
similarity index 85%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Encoder.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Encoder.php
index 77988a192..fef9b5890 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Encoder.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Encoder.php
@@ -10,19 +10,27 @@ class HTMLPurifier_Encoder
/**
* Constructor throws fatal error if you attempt to instantiate class
*/
- private function __construct() {
+ private function __construct()
+ {
trigger_error('Cannot instantiate encoder, call methods statically', E_USER_ERROR);
}
/**
* Error-handler that mutes errors, alternative to shut-up operator.
*/
- public static function muteErrorHandler() {}
+ public static function muteErrorHandler()
+ {
+ }
/**
* iconv wrapper which mutes errors, but doesn't work around bugs.
+ * @param string $in Input encoding
+ * @param string $out Output encoding
+ * @param string $text The text to convert
+ * @return string
*/
- public static function unsafeIconv($in, $out, $text) {
+ public static function unsafeIconv($in, $out, $text)
+ {
set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler'));
$r = iconv($in, $out, $text);
restore_error_handler();
@@ -31,8 +39,14 @@ class HTMLPurifier_Encoder
/**
* iconv wrapper which mutes errors and works around bugs.
+ * @param string $in Input encoding
+ * @param string $out Output encoding
+ * @param string $text The text to convert
+ * @param int $max_chunk_size
+ * @return string
*/
- public static function iconv($in, $out, $text, $max_chunk_size = 8000) {
+ public static function iconv($in, $out, $text, $max_chunk_size = 8000)
+ {
$code = self::testIconvTruncateBug();
if ($code == self::ICONV_OK) {
return self::unsafeIconv($in, $out, $text);
@@ -87,6 +101,10 @@ class HTMLPurifier_Encoder
* It will parse according to UTF-8 and return a valid UTF8 string, with
* non-SGML codepoints excluded.
*
+ * @param string $str The string to clean
+ * @param bool $force_php
+ * @return string
+ *
* @note Just for reference, the non-SGML code points are 0 to 31 and
* 127 to 159, inclusive. However, we allow code points 9, 10
* and 13, which are the tab, line feed and carriage return
@@ -106,14 +124,17 @@ class HTMLPurifier_Encoder
* would need that, and I'm probably not going to implement them.
* Once again, PHP 6 should solve all our problems.
*/
- public static function cleanUTF8($str, $force_php = false) {
-
+ public static function cleanUTF8($str, $force_php = false)
+ {
// UTF-8 validity is checked since PHP 4.3.5
// This is an optimization: if the string is already valid UTF-8, no
// need to do PHP stuff. 99% of the time, this will be the case.
// The regexp matches the XML char production, as well as well as excluding
// non-SGML codepoints U+007F to U+009F
- if (preg_match('/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', $str)) {
+ if (preg_match(
+ '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du',
+ $str
+ )) {
return $str;
}
@@ -132,7 +153,7 @@ class HTMLPurifier_Encoder
$char = '';
$len = strlen($str);
- for($i = 0; $i < $len; $i++) {
+ for ($i = 0; $i < $len; $i++) {
$in = ord($str{$i});
$char .= $str[$i]; // append byte to char
if (0 == $mState) {
@@ -285,8 +306,9 @@ class HTMLPurifier_Encoder
// | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes
// +----------+----------+----------+----------+
- public static function unichr($code) {
- if($code > 1114111 or $code < 0 or
+ public static function unichr($code)
+ {
+ if ($code > 1114111 or $code < 0 or
($code >= 55296 and $code <= 57343) ) {
// bits are set outside the "valid" range as defined
// by UNICODE 4.1.0
@@ -304,7 +326,7 @@ class HTMLPurifier_Encoder
$y = (($code & 2047) >> 6) | 192;
} else {
$y = (($code & 4032) >> 6) | 128;
- if($code < 65536) {
+ if ($code < 65536) {
$z = (($code >> 12) & 15) | 224;
} else {
$z = (($code >> 12) & 63) | 128;
@@ -314,15 +336,25 @@ class HTMLPurifier_Encoder
}
// set up the actual character
$ret = '';
- if($w) $ret .= chr($w);
- if($z) $ret .= chr($z);
- if($y) $ret .= chr($y);
+ if ($w) {
+ $ret .= chr($w);
+ }
+ if ($z) {
+ $ret .= chr($z);
+ }
+ if ($y) {
+ $ret .= chr($y);
+ }
$ret .= chr($x);
return $ret;
}
- public static function iconvAvailable() {
+ /**
+ * @return bool
+ */
+ public static function iconvAvailable()
+ {
static $iconv = null;
if ($iconv === null) {
$iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE;
@@ -331,13 +363,22 @@ class HTMLPurifier_Encoder
}
/**
- * Converts a string to UTF-8 based on configuration.
+ * Convert a string to UTF-8 based on configuration.
+ * @param string $str The string to convert
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return string
*/
- public static function convertToUTF8($str, $config, $context) {
+ public static function convertToUTF8($str, $config, $context)
+ {
$encoding = $config->get('Core.Encoding');
- if ($encoding === 'utf-8') return $str;
+ if ($encoding === 'utf-8') {
+ return $str;
+ }
static $iconv = null;
- if ($iconv === null) $iconv = self::iconvAvailable();
+ if ($iconv === null) {
+ $iconv = self::iconvAvailable();
+ }
if ($iconv && !$config->get('Test.ForceNoIconv')) {
// unaffected by bugs, since UTF-8 support all characters
$str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str);
@@ -359,29 +400,44 @@ class HTMLPurifier_Encoder
if ($bug == self::ICONV_OK) {
trigger_error('Encoding not supported, please install iconv', E_USER_ERROR);
} else {
- trigger_error('You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', E_USER_ERROR);
+ trigger_error(
+ 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' .
+ 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541',
+ E_USER_ERROR
+ );
}
}
/**
* Converts a string from UTF-8 based on configuration.
+ * @param string $str The string to convert
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return string
* @note Currently, this is a lossy conversion, with unexpressable
* characters being omitted.
*/
- public static function convertFromUTF8($str, $config, $context) {
+ public static function convertFromUTF8($str, $config, $context)
+ {
$encoding = $config->get('Core.Encoding');
if ($escape = $config->get('Core.EscapeNonASCIICharacters')) {
$str = self::convertToASCIIDumbLossless($str);
}
- if ($encoding === 'utf-8') return $str;
+ if ($encoding === 'utf-8') {
+ return $str;
+ }
static $iconv = null;
- if ($iconv === null) $iconv = self::iconvAvailable();
+ if ($iconv === null) {
+ $iconv = self::iconvAvailable();
+ }
if ($iconv && !$config->get('Test.ForceNoIconv')) {
// Undo our previous fix in convertToUTF8, otherwise iconv will barf
$ascii_fix = self::testEncodingSupportsASCII($encoding);
if (!$escape && !empty($ascii_fix)) {
$clear_fix = array();
- foreach ($ascii_fix as $utf8 => $native) $clear_fix[$utf8] = '';
+ foreach ($ascii_fix as $utf8 => $native) {
+ $clear_fix[$utf8] = '';
+ }
$str = strtr($str, $clear_fix);
}
$str = strtr($str, array_flip($ascii_fix));
@@ -401,8 +457,8 @@ class HTMLPurifier_Encoder
/**
* Lossless (character-wise) conversion of HTML to ASCII
- * @param $str UTF-8 string to be converted to ASCII
- * @returns ASCII encoded string with non-ASCII character entity-ized
+ * @param string $str UTF-8 string to be converted to ASCII
+ * @return string ASCII encoded string with non-ASCII character entity-ized
* @warning Adapted from MediaWiki, claiming fair use: this is a common
* algorithm. If you disagree with this license fudgery,
* implement it yourself.
@@ -415,27 +471,28 @@ class HTMLPurifier_Encoder
* @note Sort of with cleanUTF8() but it assumes that $str is
* well-formed UTF-8
*/
- public static function convertToASCIIDumbLossless($str) {
+ public static function convertToASCIIDumbLossless($str)
+ {
$bytesleft = 0;
$result = '';
$working = 0;
$len = strlen($str);
- for( $i = 0; $i < $len; $i++ ) {
- $bytevalue = ord( $str[$i] );
- if( $bytevalue <= 0x7F ) { //0xxx xxxx
- $result .= chr( $bytevalue );
+ for ($i = 0; $i < $len; $i++) {
+ $bytevalue = ord($str[$i]);
+ if ($bytevalue <= 0x7F) { //0xxx xxxx
+ $result .= chr($bytevalue);
$bytesleft = 0;
- } elseif( $bytevalue <= 0xBF ) { //10xx xxxx
+ } elseif ($bytevalue <= 0xBF) { //10xx xxxx
$working = $working << 6;
$working += ($bytevalue & 0x3F);
$bytesleft--;
- if( $bytesleft <= 0 ) {
+ if ($bytesleft <= 0) {
$result .= "" . $working . ";";
}
- } elseif( $bytevalue <= 0xDF ) { //110x xxxx
+ } elseif ($bytevalue <= 0xDF) { //110x xxxx
$working = $bytevalue & 0x1F;
$bytesleft = 1;
- } elseif( $bytevalue <= 0xEF ) { //1110 xxxx
+ } elseif ($bytevalue <= 0xEF) { //1110 xxxx
$working = $bytevalue & 0x0F;
$bytesleft = 2;
} else { //1111 0xxx
@@ -469,9 +526,10 @@ class HTMLPurifier_Encoder
* characters, as long as PHP ignores the error code. If PHP starts
* paying attention to the error code, iconv becomes unusable.
*
- * @returns Error code indicating severity of bug.
+ * @return int Error code indicating severity of bug.
*/
- public static function testIconvTruncateBug() {
+ public static function testIconvTruncateBug()
+ {
static $code = null;
if ($code === null) {
// better not use iconv, otherwise infinite loop!
@@ -481,7 +539,11 @@ class HTMLPurifier_Encoder
} elseif (($c = strlen($r)) < 9000) {
$code = self::ICONV_TRUNCATES;
} elseif ($c > 9000) {
- trigger_error('Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: include your iconv version as per phpversion()', E_USER_ERROR);
+ trigger_error(
+ 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' .
+ 'include your iconv version as per phpversion()',
+ E_USER_ERROR
+ );
} else {
$code = self::ICONV_OK;
}
@@ -500,7 +562,8 @@ class HTMLPurifier_Encoder
* @return Array of UTF-8 characters to their corresponding ASCII,
* which can be used to "undo" any overzealous iconv action.
*/
- public static function testEncodingSupportsASCII($encoding, $bypass = false) {
+ public static function testEncodingSupportsASCII($encoding, $bypass = false)
+ {
// All calls to iconv here are unsafe, proof by case analysis:
// If ICONV_OK, no difference.
// If ICONV_TRUNCATE, all calls involve one character inputs,
@@ -508,7 +571,9 @@ class HTMLPurifier_Encoder
// If ICONV_UNUSABLE, this call is irrelevant
static $encodings = array();
if (!$bypass) {
- if (isset($encodings[$encoding])) return $encodings[$encoding];
+ if (isset($encodings[$encoding])) {
+ return $encodings[$encoding];
+ }
$lenc = strtolower($encoding);
switch ($lenc) {
case 'shift_jis':
@@ -516,15 +581,18 @@ class HTMLPurifier_Encoder
case 'johab':
return array("\xE2\x82\xA9" => '\\');
}
- if (strpos($lenc, 'iso-8859-') === 0) return array();
+ if (strpos($lenc, 'iso-8859-') === 0) {
+ return array();
+ }
}
$ret = array();
- if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) return false;
+ if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) {
+ return false;
+ }
for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars
$c = chr($i); // UTF-8 char
$r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion
- if (
- $r === '' ||
+ if ($r === '' ||
// This line is needed for iconv implementations that do not
// omit characters that do not exist in the target character set
($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c)
@@ -538,8 +606,6 @@ class HTMLPurifier_Encoder
$encodings[$encoding] = $ret;
return $ret;
}
-
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityLookup.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityLookup.php
similarity index 75%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityLookup.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityLookup.php
index b4dfce94c..f12ff13a3 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityLookup.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityLookup.php
@@ -3,20 +3,23 @@
/**
* Object that provides entity lookup table from entity name to character
*/
-class HTMLPurifier_EntityLookup {
-
+class HTMLPurifier_EntityLookup
+{
/**
* Assoc array of entity name to character represented.
+ * @type array
*/
public $table;
/**
* Sets up the entity lookup table from the serialized file contents.
+ * @param bool $file
* @note The serialized contents are versioned, but were generated
* using the maintenance script generate_entity_file.php
* @warning This is not in constructor to help enforce the Singleton
*/
- public function setup($file = false) {
+ public function setup($file = false)
+ {
if (!$file) {
$file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/EntityLookup/entities.ser';
}
@@ -25,9 +28,11 @@ class HTMLPurifier_EntityLookup {
/**
* Retrieves sole instance of the object.
- * @param Optional prototype of custom lookup table to overload with.
+ * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with.
+ * @return HTMLPurifier_EntityLookup
*/
- public static function instance($prototype = false) {
+ public static function instance($prototype = false)
+ {
// no references, since PHP doesn't copy unless modified
static $instance = null;
if ($prototype) {
@@ -38,7 +43,6 @@ class HTMLPurifier_EntityLookup {
}
return $instance;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityLookup/entities.ser b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityLookup/entities.ser
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityLookup/entities.ser
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityLookup/entities.ser
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityParser.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityParser.php
similarity index 75%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityParser.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityParser.php
index 8c384472d..61529dcd9 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/EntityParser.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/EntityParser.php
@@ -12,19 +12,21 @@ class HTMLPurifier_EntityParser
/**
* Reference to entity lookup table.
+ * @type HTMLPurifier_EntityLookup
*/
protected $_entity_lookup;
/**
* Callback regex string for parsing entities.
+ * @type string
*/
protected $_substituteEntitiesRegex =
-'/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/';
-// 1. hex 2. dec 3. string (XML style)
-
+ '/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/';
+ // 1. hex 2. dec 3. string (XML style)
/**
* Decimal to parsed string conversion table for special entities.
+ * @type array
*/
protected $_special_dec2str =
array(
@@ -37,6 +39,7 @@ class HTMLPurifier_EntityParser
/**
* Stripped entity names to decimal conversion table for special entities.
+ * @type array
*/
protected $_special_ent2dec =
array(
@@ -51,41 +54,45 @@ class HTMLPurifier_EntityParser
* running this whenever you have parsed character is t3h 5uck, we run
* it before everything else.
*
- * @param $string String to have non-special entities parsed.
- * @returns Parsed string.
+ * @param string $string String to have non-special entities parsed.
+ * @return string Parsed string.
*/
- public function substituteNonSpecialEntities($string) {
+ public function substituteNonSpecialEntities($string)
+ {
// it will try to detect missing semicolons, but don't rely on it
return preg_replace_callback(
$this->_substituteEntitiesRegex,
array($this, 'nonSpecialEntityCallback'),
$string
- );
+ );
}
/**
* Callback function for substituteNonSpecialEntities() that does the work.
*
- * @param $matches PCRE matches array, with 0 the entire match, and
+ * @param array $matches PCRE matches array, with 0 the entire match, and
* either index 1, 2 or 3 set with a hex value, dec value,
* or string (respectively).
- * @returns Replacement string.
+ * @return string Replacement string.
*/
- protected function nonSpecialEntityCallback($matches) {
+ protected function nonSpecialEntityCallback($matches)
+ {
// replaces all but big five
$entity = $matches[0];
$is_num = (@$matches[0][1] === '#');
if ($is_num) {
$is_hex = (@$entity[2] === 'x');
$code = $is_hex ? hexdec($matches[1]) : (int) $matches[2];
-
// abort for special characters
- if (isset($this->_special_dec2str[$code])) return $entity;
-
+ if (isset($this->_special_dec2str[$code])) {
+ return $entity;
+ }
return HTMLPurifier_Encoder::unichr($code);
} else {
- if (isset($this->_special_ent2dec[$matches[3]])) return $entity;
+ if (isset($this->_special_ent2dec[$matches[3]])) {
+ return $entity;
+ }
if (!$this->_entity_lookup) {
$this->_entity_lookup = HTMLPurifier_EntityLookup::instance();
}
@@ -103,14 +110,16 @@ class HTMLPurifier_EntityParser
* @notice We try to avoid calling this function because otherwise, it
* would have to be called a lot (for every parsed section).
*
- * @param $string String to have non-special entities parsed.
- * @returns Parsed string.
+ * @param string $string String to have non-special entities parsed.
+ * @return string Parsed string.
*/
- public function substituteSpecialEntities($string) {
+ public function substituteSpecialEntities($string)
+ {
return preg_replace_callback(
$this->_substituteEntitiesRegex,
array($this, 'specialEntityCallback'),
- $string);
+ $string
+ );
}
/**
@@ -118,12 +127,13 @@ class HTMLPurifier_EntityParser
*
* This callback has same syntax as nonSpecialEntityCallback().
*
- * @param $matches PCRE-style matches array, with 0 the entire match, and
+ * @param array $matches PCRE-style matches array, with 0 the entire match, and
* either index 1, 2 or 3 set with a hex value, dec value,
* or string (respectively).
- * @returns Replacement string.
+ * @return string Replacement string.
*/
- protected function specialEntityCallback($matches) {
+ protected function specialEntityCallback($matches)
+ {
$entity = $matches[0];
$is_num = (@$matches[0][1] === '#');
if ($is_num) {
@@ -138,7 +148,6 @@ class HTMLPurifier_EntityParser
$entity;
}
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorCollector.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorCollector.php
similarity index 82%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorCollector.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorCollector.php
index 6713eaf77..d47e3f2e2 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorCollector.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorCollector.php
@@ -16,16 +16,46 @@ class HTMLPurifier_ErrorCollector
const MESSAGE = 2;
const CHILDREN = 3;
+ /**
+ * @type array
+ */
protected $errors;
+
+ /**
+ * @type array
+ */
protected $_current;
+
+ /**
+ * @type array
+ */
protected $_stacks = array(array());
+
+ /**
+ * @type HTMLPurifier_Language
+ */
protected $locale;
+
+ /**
+ * @type HTMLPurifier_Generator
+ */
protected $generator;
+
+ /**
+ * @type HTMLPurifier_Context
+ */
protected $context;
+ /**
+ * @type array
+ */
protected $lines = array();
- public function __construct($context) {
+ /**
+ * @param HTMLPurifier_Context $context
+ */
+ public function __construct($context)
+ {
$this->locale =& $context->get('Locale');
$this->context = $context;
$this->_current =& $this->_stacks[0];
@@ -34,13 +64,11 @@ class HTMLPurifier_ErrorCollector
/**
* Sends an error message to the collector for later use
- * @param $severity int Error severity, PHP error style (don't use E_USER_)
- * @param $msg string Error message text
- * @param $subst1 string First substitution for $msg
- * @param $subst2 string ...
+ * @param int $severity Error severity, PHP error style (don't use E_USER_)
+ * @param string $msg Error message text
*/
- public function send($severity, $msg) {
-
+ public function send($severity, $msg)
+ {
$args = array();
if (func_num_args() > 2) {
$args = func_get_args();
@@ -50,7 +78,7 @@ class HTMLPurifier_ErrorCollector
$token = $this->context->get('CurrentToken', true);
$line = $token ? $token->line : $this->context->get('CurrentLine', true);
- $col = $token ? $token->col : $this->context->get('CurrentCol', true);
+ $col = $token ? $token->col : $this->context->get('CurrentCol', true);
$attr = $this->context->get('CurrentAttr', true);
// perform special substitutions, also add custom parameters
@@ -60,7 +88,9 @@ class HTMLPurifier_ErrorCollector
}
if (!is_null($attr)) {
$subst['$CurrentAttr.Name'] = $attr;
- if (isset($token->attr[$attr])) $subst['$CurrentAttr.Value'] = $token->attr[$attr];
+ if (isset($token->attr[$attr])) {
+ $subst['$CurrentAttr.Value'] = $token->attr[$attr];
+ }
}
if (empty($args)) {
@@ -69,7 +99,9 @@ class HTMLPurifier_ErrorCollector
$msg = $this->locale->formatMessage($msg, $args);
}
- if (!empty($subst)) $msg = strtr($msg, $subst);
+ if (!empty($subst)) {
+ $msg = strtr($msg, $subst);
+ }
// (numerically indexed)
$error = array(
@@ -80,16 +112,15 @@ class HTMLPurifier_ErrorCollector
);
$this->_current[] = $error;
-
// NEW CODE BELOW ...
-
- $struct = null;
// Top-level errors are either:
// TOKEN type, if $value is set appropriately, or
// "syntax" type, if $value is null
$new_struct = new HTMLPurifier_ErrorStruct();
$new_struct->type = HTMLPurifier_ErrorStruct::TOKEN;
- if ($token) $new_struct->value = clone $token;
+ if ($token) {
+ $new_struct->value = clone $token;
+ }
if (is_int($line) && is_int($col)) {
if (isset($this->lines[$line][$col])) {
$struct = $this->lines[$line][$col];
@@ -128,30 +159,34 @@ class HTMLPurifier_ErrorCollector
/**
* Retrieves raw error data for custom formatter to use
- * @param List of arrays in format of array(line of error,
- * error severity, error message,
- * recursive sub-errors array)
*/
- public function getRaw() {
+ public function getRaw()
+ {
return $this->errors;
}
/**
* Default HTML formatting implementation for error messages
- * @param $config Configuration array, vital for HTML output nature
- * @param $errors Errors array to display; used for recursion.
+ * @param HTMLPurifier_Config $config Configuration, vital for HTML output nature
+ * @param array $errors Errors array to display; used for recursion.
+ * @return string
*/
- public function getHTMLFormatted($config, $errors = null) {
+ public function getHTMLFormatted($config, $errors = null)
+ {
$ret = array();
$this->generator = new HTMLPurifier_Generator($config, $this->context);
- if ($errors === null) $errors = $this->errors;
+ if ($errors === null) {
+ $errors = $this->errors;
+ }
// 'At line' message needs to be removed
// generation code for new structure goes here. It needs to be recursive.
foreach ($this->lines as $line => $col_array) {
- if ($line == -1) continue;
+ if ($line == -1) {
+ continue;
+ }
foreach ($col_array as $col => $struct) {
$this->_renderStruct($ret, $struct, $line, $col);
}
@@ -168,7 +203,8 @@ class HTMLPurifier_ErrorCollector
}
- private function _renderStruct(&$ret, $struct, $line = null, $col = null) {
+ private function _renderStruct(&$ret, $struct, $line = null, $col = null)
+ {
$stack = array($struct);
$context_stack = array(array());
while ($current = array_pop($stack)) {
@@ -194,7 +230,7 @@ class HTMLPurifier_ErrorCollector
//$string .= '';
$ret[] = $string;
}
- foreach ($current->children as $type => $array) {
+ foreach ($current->children as $array) {
$context[] = $current;
$stack = array_merge($stack, array_reverse($array, true));
for ($i = count($array); $i > 0; $i--) {
@@ -203,7 +239,6 @@ class HTMLPurifier_ErrorCollector
}
}
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorStruct.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorStruct.php
similarity index 81%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorStruct.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorStruct.php
index 9bc8996ec..cf869d321 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/ErrorStruct.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/ErrorStruct.php
@@ -19,6 +19,7 @@ class HTMLPurifier_ErrorStruct
/**
* Type of this struct.
+ * @type string
*/
public $type;
@@ -28,11 +29,13 @@ class HTMLPurifier_ErrorStruct
* - TOKEN: Instance of HTMLPurifier_Token
* - ATTR: array('attr-name', 'value')
* - CSSPROP: array('prop-name', 'value')
+ * @type mixed
*/
public $value;
/**
* Errors registered for this structure.
+ * @type array
*/
public $errors = array();
@@ -40,10 +43,17 @@ class HTMLPurifier_ErrorStruct
* Child ErrorStructs that are from this structure. For example, a TOKEN
* ErrorStruct would contain ATTR ErrorStructs. This is a multi-dimensional
* array in structure: [TYPE]['identifier']
+ * @type array
*/
public $children = array();
- public function getChild($type, $id) {
+ /**
+ * @param string $type
+ * @param string $id
+ * @return mixed
+ */
+ public function getChild($type, $id)
+ {
if (!isset($this->children[$type][$id])) {
$this->children[$type][$id] = new HTMLPurifier_ErrorStruct();
$this->children[$type][$id]->type = $type;
@@ -51,10 +61,14 @@ class HTMLPurifier_ErrorStruct
return $this->children[$type][$id];
}
- public function addError($severity, $message) {
+ /**
+ * @param int $severity
+ * @param string $message
+ */
+ public function addError($severity, $message)
+ {
$this->errors[] = array($severity, $message);
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Exception.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Exception.php
similarity index 100%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Exception.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Exception.php
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter.php
similarity index 71%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter.php
index 9a0e7b09f..c1f41ee16 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter.php
@@ -23,24 +23,34 @@ class HTMLPurifier_Filter
{
/**
- * Name of the filter for identification purposes
+ * Name of the filter for identification purposes.
+ * @type string
*/
public $name;
/**
* Pre-processor function, handles HTML before HTML Purifier
+ * @param string $html
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return string
*/
- public function preFilter($html, $config, $context) {
+ public function preFilter($html, $config, $context)
+ {
return $html;
}
/**
* Post-processor function, handles HTML after HTML Purifier
+ * @param string $html
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return string
*/
- public function postFilter($html, $config, $context) {
+ public function postFilter($html, $config, $context)
+ {
return $html;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
similarity index 87%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
index df937ace7..08e62c16b 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
@@ -4,7 +4,9 @@
// understand how to interpret this filter if it's a static method.
// It's all really silly, but if we go this route it might be reasonable
// to coalesce all of these methods into one.
-function htmlpurifier_filter_extractstyleblocks_muteerrorhandler() {}
+function htmlpurifier_filter_extractstyleblocks_muteerrorhandler()
+{
+}
/**
* This filter extracts #isU', array($this, 'styleCallback'), $html);
$style_blocks = $this->_styleMatches;
$this->_styleMatches = array(); // reset
@@ -69,12 +110,14 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
/**
* Takes CSS (the stuff found in in a font-family prop).
if ($config->get('Filter.ExtractStyleBlocks.Escaping')) {
$css = str_replace(
- array('<', '>', '&'),
+ array('<', '>', '&'),
array('\3C ', '\3E ', '\26 '),
$css
);
}
return $css;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/YouTube.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/YouTube.php
new file mode 100644
index 000000000..411519ad6
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Filter/YouTube.php
@@ -0,0 +1,65 @@
+]+>.+?' .
+ 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s';
+ $pre_replace = '\1';
+ return preg_replace($pre_regex, $pre_replace, $html);
+ }
+
+ /**
+ * @param string $html
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return string
+ */
+ public function postFilter($html, $config, $context)
+ {
+ $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#';
+ return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html);
+ }
+
+ /**
+ * @param $url
+ * @return string
+ */
+ protected function armorUrl($url)
+ {
+ return str_replace('--', '--', $url);
+ }
+
+ /**
+ * @param array $matches
+ * @return string
+ */
+ protected function postFilterCallback($matches)
+ {
+ $url = $this->armorUrl($matches[1]);
+ return '';
+ }
+}
+
+// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Generator.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Generator.php
similarity index 76%
rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Generator.php
rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Generator.php
index fee1a5f84..6fb568714 100644
--- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Generator.php
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Generator.php
@@ -11,52 +11,61 @@ class HTMLPurifier_Generator
{
/**
- * Whether or not generator should produce XML output
+ * Whether or not generator should produce XML output.
+ * @type bool
*/
private $_xhtml = true;
/**
- * :HACK: Whether or not generator should comment the insides of )#si',
- array($this, 'scriptCallback'), $html);
+ $html = preg_replace_callback(
+ '#()#si',
+ array($this, 'scriptCallback'),
+ $html
+ );
}
$html = $this->normalize($html, $config, $context);
@@ -55,15 +69,15 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
if ($maintain_line_numbers) {
$current_line = 1;
- $current_col = 0;
+ $current_col = 0;
$length = strlen($html);
} else {
$current_line = false;
- $current_col = false;
+ $current_col = false;
$length = false;
}
$context->register('CurrentLine', $current_line);
- $context->register('CurrentCol', $current_col);
+ $context->register('CurrentCol', $current_col);
$nl = "\n";
// how often to manually recalculate. This will ALWAYS be right,
// but it's pretty wasteful. Set to 0 to turn off
@@ -77,16 +91,14 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
// for testing synchronization
$loops = 0;
- while(++$loops) {
-
+ while (++$loops) {
// $cursor is either at the start of a token, or inside of
// a tag (i.e. there was a < immediately before it), as indicated
// by $inside_tag
if ($maintain_line_numbers) {
-
// $rcursor, however, is always at the start of a token.
- $rcursor = $cursor - (int) $inside_tag;
+ $rcursor = $cursor - (int)$inside_tag;
// Column number is cheap, so we calculate it every round.
// We're interested at the *end* of the newline string, so
@@ -96,14 +108,11 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
$current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1);
// recalculate lines
- if (
- $synchronize_interval && // synchronization is on
- $cursor > 0 && // cursor is further than zero
- $loops % $synchronize_interval === 0 // time to synchronize!
- ) {
+ if ($synchronize_interval && // synchronization is on
+ $cursor > 0 && // cursor is further than zero
+ $loops % $synchronize_interval === 0) { // time to synchronize!
$current_line = 1 + $this->substrCount($html, $nl, 0, $cursor);
}
-
}
$position_next_lt = strpos($html, '<', $cursor);
@@ -119,35 +128,42 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
if (!$inside_tag && $position_next_lt !== false) {
// We are not inside tag and there still is another tag to parse
$token = new
- HTMLPurifier_Token_Text(
- $this->parseData(
- substr(
- $html, $cursor, $position_next_lt - $cursor
- )
+ HTMLPurifier_Token_Text(
+ $this->parseData(
+ substr(
+ $html,
+ $cursor,
+ $position_next_lt - $cursor
)
- );
+ )
+ );
if ($maintain_line_numbers) {
$token->rawPosition($current_line, $current_col);
$current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor);
}
$array[] = $token;
- $cursor = $position_next_lt + 1;
+ $cursor = $position_next_lt + 1;
$inside_tag = true;
continue;
} elseif (!$inside_tag) {
// We are not inside tag but there are no more tags
// If we're already at the end, break
- if ($cursor === strlen($html)) break;
+ if ($cursor === strlen($html)) {
+ break;
+ }
// Create Text of rest of string
$token = new
- HTMLPurifier_Token_Text(
- $this->parseData(
- substr(
- $html, $cursor
- )
+ HTMLPurifier_Token_Text(
+ $this->parseData(
+ substr(
+ $html,
+ $cursor
)
- );
- if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col);
+ )
+ );
+ if ($maintain_line_numbers) {
+ $token->rawPosition($current_line, $current_col);
+ }
$array[] = $token;
break;
} elseif ($inside_tag && $position_next_gt !== false) {
@@ -171,16 +187,16 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
}
// Check if it's a comment
- if (
- substr($segment, 0, 3) === '!--'
- ) {
+ if (substr($segment, 0, 3) === '!--') {
// re-determine segment length, looking for -->
$position_comment_end = strpos($html, '-->', $cursor);
if ($position_comment_end === false) {
// uh oh, we have a comment that extends to
// infinity. Can't be helped: set comment
// end position to end of string
- if ($e) $e->send(E_WARNING, 'Lexer: Unclosed comment');
+ if ($e) {
+ $e->send(E_WARNING, 'Lexer: Unclosed comment');
+ }
$position_comment_end = strlen($html);
$end = true;
} else {
@@ -189,11 +205,13 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
$strlen_segment = $position_comment_end - $cursor;
$segment = substr($html, $cursor, $strlen_segment);
$token = new
- HTMLPurifier_Token_Comment(
- substr(
- $segment, 3, $strlen_segment - 3
- )
- );
+ HTMLPurifier_Token_Comment(
+ substr(
+ $segment,
+ 3,
+ $strlen_segment - 3
+ )
+ );
if ($maintain_line_numbers) {
$token->rawPosition($current_line, $current_col);
$current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment);
@@ -205,7 +223,7 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
}
// Check if it's an end tag
- $is_end_tag = (strpos($segment,'/') === 0);
+ $is_end_tag = (strpos($segment, '/') === 0);
if ($is_end_tag) {
$type = substr($segment, 1);
$token = new HTMLPurifier_Token_End($type);
@@ -224,7 +242,9 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
// text and go our merry way
if (!ctype_alpha($segment[0])) {
// XML: $segment[0] !== '_' && $segment[0] !== ':'
- if ($e) $e->send(E_NOTICE, 'Lexer: Unescaped lt');
+ if ($e) {
+ $e->send(E_NOTICE, 'Lexer: Unescaped lt');
+ }
$token = new HTMLPurifier_Token_Text('<');
if ($maintain_line_numbers) {
$token->rawPosition($current_line, $current_col);
@@ -239,7 +259,7 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
// trailing slash. Remember, we could have a tag like
, so
// any later token processing scripts must convert improperly
// classified EmptyTags from StartTags.
- $is_self_closing = (strrpos($segment,'/') === $strlen_segment-1);
+ $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1);
if ($is_self_closing) {
$strlen_segment--;
$segment = substr($segment, 0, $strlen_segment);
@@ -269,14 +289,16 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
$attribute_string =
trim(
substr(
- $segment, $position_first_space
+ $segment,
+ $position_first_space
)
);
if ($attribute_string) {
$attr = $this->parseAttributeString(
- $attribute_string
- , $config, $context
- );
+ $attribute_string,
+ $config,
+ $context
+ );
} else {
$attr = array();
}
@@ -296,15 +318,19 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
continue;
} else {
// inside tag, but there's no ending > sign
- if ($e) $e->send(E_WARNING, 'Lexer: Missing gt');
+ if ($e) {
+ $e->send(E_WARNING, 'Lexer: Missing gt');
+ }
$token = new
- HTMLPurifier_Token_Text(
- '<' .
- $this->parseData(
- substr($html, $cursor)
- )
- );
- if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col);
+ HTMLPurifier_Token_Text(
+ '<' .
+ $this->parseData(
+ substr($html, $cursor)
+ )
+ );
+ if ($maintain_line_numbers) {
+ $token->rawPosition($current_line, $current_col);
+ }
// no cursor scroll? Hmm...
$array[] = $token;
break;
@@ -319,8 +345,14 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
/**
* PHP 5.0.x compatible substr_count that implements offset and length
+ * @param string $haystack
+ * @param string $needle
+ * @param int $offset
+ * @param int $length
+ * @return int
*/
- protected function substrCount($haystack, $needle, $offset, $length) {
+ protected function substrCount($haystack, $needle, $offset, $length)
+ {
static $oldVersion;
if ($oldVersion === null) {
$oldVersion = version_compare(PHP_VERSION, '5.1', '<');
@@ -336,13 +368,18 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
/**
* Takes the inside of an HTML tag and makes an assoc array of attributes.
*
- * @param $string Inside of tag excluding name.
- * @returns Assoc array of attributes.
+ * @param string $string Inside of tag excluding name.
+ * @param HTMLPurifier_Config $config
+ * @param HTMLPurifier_Context $context
+ * @return array Assoc array of attributes.
*/
- public function parseAttributeString($string, $config, $context) {
- $string = (string) $string; // quick typecast
+ public function parseAttributeString($string, $config, $context)
+ {
+ $string = (string)$string; // quick typecast
- if ($string == '') return array(); // no attributes
+ if ($string == '') {
+ return array();
+ } // no attributes
$e = false;
if ($config->get('Core.CollectErrors')) {
@@ -361,46 +398,55 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
list($key, $quoted_value) = explode('=', $string);
$quoted_value = trim($quoted_value);
if (!$key) {
- if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key');
+ if ($e) {
+ $e->send(E_ERROR, 'Lexer: Missing attribute key');
+ }
return array();
}
- if (!$quoted_value) return array($key => '');
+ if (!$quoted_value) {
+ return array($key => '');
+ }
$first_char = @$quoted_value[0];
- $last_char = @$quoted_value[strlen($quoted_value)-1];
+ $last_char = @$quoted_value[strlen($quoted_value) - 1];
$same_quote = ($first_char == $last_char);
$open_quote = ($first_char == '"' || $first_char == "'");
- if ( $same_quote && $open_quote) {
+ if ($same_quote && $open_quote) {
// well behaved
$value = substr($quoted_value, 1, strlen($quoted_value) - 2);
} else {
// not well behaved
if ($open_quote) {
- if ($e) $e->send(E_ERROR, 'Lexer: Missing end quote');
+ if ($e) {
+ $e->send(E_ERROR, 'Lexer: Missing end quote');
+ }
$value = substr($quoted_value, 1);
} else {
$value = $quoted_value;
}
}
- if ($value === false) $value = '';
+ if ($value === false) {
+ $value = '';
+ }
return array($key => $this->parseData($value));
}
// setup loop environment
- $array = 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)
+ $size = strlen($string); // size of the string (stays the same)
// if we have unquoted attributes, the parser expects a terminating
// space, so let's guarantee that there's always a terminating space.
$string .= ' ';
- while(true) {
-
- if ($cursor >= $size) {
- break;
+ $old_cursor = -1;
+ while ($cursor < $size) {
+ if ($old_cursor >= $cursor) {
+ throw new Exception("Infinite loop detected");
}
+ $old_cursor = $cursor;
$cursor += ($value = strspn($string, $this->_whitespace, $cursor));
// grab the key
@@ -415,8 +461,10 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
$key = substr($string, $key_begin, $key_end - $key_begin);
if (!$key) {
- if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key');
- $cursor += strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop
+ if ($e) {
+ $e->send(E_ERROR, 'Lexer: Missing attribute key');
+ }
+ $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop
continue; // empty key
}
@@ -467,24 +515,25 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
}
$value = substr($string, $value_begin, $value_end - $value_begin);
- if ($value === false) $value = '';
+ if ($value === false) {
+ $value = '';
+ }
$array[$key] = $this->parseData($value);
$cursor++;
-
} else {
// boolattr
if ($key !== '') {
$array[$key] = $key;
} else {
// purely theoretical
- if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key');
+ if ($e) {
+ $e->send(E_ERROR, 'Lexer: Missing attribute key');
+ }
}
-
}
}
return $array;
}
-
}
// vim: et sw=4 sts=4
diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Lexer/PH5P.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Lexer/PH5P.php
new file mode 100644
index 000000000..a4587e4cd
--- /dev/null
+++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Lexer/PH5P.php
@@ -0,0 +1,4788 @@
+normalize($html, $config, $context);
+ $new_html = $this->wrapHTML($new_html, $config, $context);
+ try {
+ $parser = new HTML5($new_html);
+ $doc = $parser->save();
+ } catch (DOMException $e) {
+ // Uh oh, it failed. Punt to DirectLex.
+ $lexer = new HTMLPurifier_Lexer_DirectLex();
+ $context->register('PH5PError', $e); // save the error, so we can detect it
+ return $lexer->tokenizeHTML($html, $config, $context); // use original HTML
+ }
+ $tokens = array();
+ $this->tokenizeDOM(
+ $doc->getElementsByTagName('html')->item(0)-> //
+ getElementsByTagName('body')->item(0)-> //
n"; //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n\n"; $n = $this->round($n, $sigfigs); - if (strpos($n, '.') !== false) $n = rtrim($n, '0'); + if (strpos($n, '.') !== false) { + $n = rtrim($n, '0'); + } $n = rtrim($n, '.'); return new HTMLPurifier_Length($n, $unit); @@ -170,53 +189,84 @@ class HTMLPurifier_UnitConverter * @param string $n Decimal number * @return int number of sigfigs */ - public function getSigFigs($n) { + public function getSigFigs($n) + { $n = ltrim($n, '0+-'); $dp = strpos($n, '.'); // decimal position if ($dp === false) { $sigfigs = strlen(rtrim($n, '0')); } else { $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character - if ($dp !== 0) $sigfigs--; + if ($dp !== 0) { + $sigfigs--; + } } return $sigfigs; } /** * Adds two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function add($s1, $s2, $scale) { - if ($this->bcmath) return bcadd($s1, $s2, $scale); - else return $this->scale($s1 + $s2, $scale); + private function add($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcadd($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 + (float)$s2, $scale); + } } /** * Multiples two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function mul($s1, $s2, $scale) { - if ($this->bcmath) return bcmul($s1, $s2, $scale); - else return $this->scale($s1 * $s2, $scale); + private function mul($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcmul($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 * (float)$s2, $scale); + } } /** * Divides two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function div($s1, $s2, $scale) { - if ($this->bcmath) return bcdiv($s1, $s2, $scale); - else return $this->scale($s1 / $s2, $scale); + private function div($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcdiv($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 / (float)$s2, $scale); + } } /** * Rounds a number according to the number of sigfigs it should have, * using arbitrary precision when available. + * @param float $n + * @param int $sigfigs + * @return string */ - private function round($n, $sigfigs) { - $new_log = (int) floor(log(abs($n), 10)); // Number of digits left of decimal - 1 + private function round($n, $sigfigs) + { + $new_log = (int)floor(log(abs($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) { if ($rp >= 0) { - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); + $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); $n = bcdiv($n, '1', $rp); } else { // This algorithm partially depends on the standardized @@ -232,23 +282,26 @@ class HTMLPurifier_UnitConverter /** * Scales a float to $scale digits right of decimal point, like BCMath. + * @param float $r + * @param int $scale + * @return string */ - private function scale($r, $scale) { + private function scale($r, $scale) + { if ($scale < 0) { // The f sprintf type doesn't support negative numbers, so we // need to cludge things manually. First get the string. - $r = sprintf('%.0f', (float) $r); + $r = sprintf('%.0f', (float)$r); // Due to floating point precision loss, $r will more than likely // look something like 4652999999999.9234. We grab one more digit // than we need to precise from $r and then use that to round // appropriately. - $precise = (string) round(substr($r, 0, strlen($r) + $scale), -1); + $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1); // 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 sprintf('%.' . $scale . 'f', (float)$r); } - } // vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser.php new file mode 100644 index 000000000..50cba6910 --- /dev/null +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser.php @@ -0,0 +1,198 @@ + self::STRING, + 'istring' => self::ISTRING, + 'text' => self::TEXT, + 'itext' => self::ITEXT, + 'int' => self::INT, + 'float' => self::FLOAT, + 'bool' => self::BOOL, + 'lookup' => self::LOOKUP, + 'list' => self::ALIST, + 'hash' => self::HASH, + 'mixed' => self::MIXED + ); + + /** + * Lookup table of types that are string, and can have aliases or + * allowed value lists. + */ + public static $stringTypes = array( + self::STRING => true, + self::ISTRING => true, + self::TEXT => true, + self::ITEXT => true, + ); + + /** + * Validate a variable according to type. + * It may return NULL as a valid type if $allow_null is true. + * + * @param mixed $var Variable to validate + * @param int $type Type of variable, see HTMLPurifier_VarParser->types + * @param bool $allow_null Whether or not to permit null as a value + * @return string Validated and type-coerced variable + * @throws HTMLPurifier_VarParserException + */ + final public function parse($var, $type, $allow_null = false) + { + if (is_string($type)) { + if (!isset(HTMLPurifier_VarParser::$types[$type])) { + throw new HTMLPurifier_VarParserException("Invalid type '$type'"); + } else { + $type = HTMLPurifier_VarParser::$types[$type]; + } + } + $var = $this->parseImplementation($var, $type, $allow_null); + if ($allow_null && $var === null) { + return null; + } + // These are basic checks, to make sure nothing horribly wrong + // happened in our implementations. + switch ($type) { + case (self::STRING): + case (self::ISTRING): + case (self::TEXT): + case (self::ITEXT): + if (!is_string($var)) { + break; + } + if ($type == self::ISTRING || $type == self::ITEXT) { + $var = strtolower($var); + } + return $var; + case (self::INT): + if (!is_int($var)) { + break; + } + return $var; + case (self::FLOAT): + if (!is_float($var)) { + break; + } + return $var; + case (self::BOOL): + if (!is_bool($var)) { + break; + } + return $var; + case (self::LOOKUP): + case (self::ALIST): + case (self::HASH): + if (!is_array($var)) { + break; + } + if ($type === self::LOOKUP) { + foreach ($var as $k) { + if ($k !== true) { + $this->error('Lookup table contains value other than true'); + } + } + } elseif ($type === self::ALIST) { + $keys = array_keys($var); + if (array_keys($keys) !== $keys) { + $this->error('Indices for list are not uniform'); + } + } + return $var; + case (self::MIXED): + return $var; + default: + $this->errorInconsistent(get_class($this), $type); + } + $this->errorGeneric($var, $type); + } + + /** + * Actually implements the parsing. Base implementation does not + * do anything to $var. Subclasses should overload this! + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return string + */ + protected function parseImplementation($var, $type, $allow_null) + { + return $var; + } + + /** + * Throws an exception. + * @throws HTMLPurifier_VarParserException + */ + protected function error($msg) + { + throw new HTMLPurifier_VarParserException($msg); + } + + /** + * Throws an inconsistency exception. + * @note This should not ever be called. It would be called if we + * extend the allowed values of HTMLPurifier_VarParser without + * updating subclasses. + * @param string $class + * @param int $type + * @throws HTMLPurifier_Exception + */ + protected function errorInconsistent($class, $type) + { + throw new HTMLPurifier_Exception( + "Inconsistency in $class: " . HTMLPurifier_VarParser::getTypeName($type) . + " not implemented" + ); + } + + /** + * Generic error for if a type didn't work. + * @param mixed $var + * @param int $type + */ + protected function errorGeneric($var, $type) + { + $vtype = gettype($var); + $this->error("Expected type " . HTMLPurifier_VarParser::getTypeName($type) . ", got $vtype"); + } + + /** + * @param int $type + * @return string + */ + public static function getTypeName($type) + { + static $lookup; + if (!$lookup) { + // Lazy load the alternative lookup table + $lookup = array_flip(HTMLPurifier_VarParser::$types); + } + if (!isset($lookup[$type])) { + return 'unknown'; + } + return $lookup[$type]; + } +} + +// vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Flexible.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Flexible.php similarity index 63% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Flexible.php rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Flexible.php index 21b87675a..b15016c5b 100644 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Flexible.php +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Flexible.php @@ -7,28 +7,41 @@ */ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser { - - protected function parseImplementation($var, $type, $allow_null) { - if ($allow_null && $var === null) return null; + /** + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return array|bool|float|int|mixed|null|string + * @throws HTMLPurifier_VarParserException + */ + protected function parseImplementation($var, $type, $allow_null) + { + if ($allow_null && $var === null) { + return null; + } switch ($type) { // Note: if code "breaks" from the switch, it triggers a generic // exception to be thrown. Specific errors can be specifically // done here. - case self::MIXED : - case self::ISTRING : - case self::STRING : - case self::TEXT : - case self::ITEXT : + case self::MIXED: + case self::ISTRING: + case self::STRING: + case self::TEXT: + case self::ITEXT: return $var; - case self::INT : - if (is_string($var) && ctype_digit($var)) $var = (int) $var; + case self::INT: + if (is_string($var) && ctype_digit($var)) { + $var = (int)$var; + } return $var; - case self::FLOAT : - if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var; + case self::FLOAT: + if ((is_string($var) && is_numeric($var)) || is_int($var)) { + $var = (float)$var; + } return $var; - case self::BOOL : + case self::BOOL: if (is_int($var) && ($var === 0 || $var === 1)) { - $var = (bool) $var; + $var = (bool)$var; } elseif (is_string($var)) { if ($var == 'on' || $var == 'true' || $var == '1') { $var = true; @@ -39,45 +52,56 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser } } return $var; - case self::ALIST : - case self::HASH : - case self::LOOKUP : + case self::ALIST: + case self::HASH: + case self::LOOKUP: if (is_string($var)) { // special case: technically, this is an array with // a single empty string item, but having an empty // array is more intuitive - if ($var == '') return array(); + if ($var == '') { + return array(); + } if (strpos($var, "\n") === false && strpos($var, "\r") === false) { // simplistic string to array method that only works // for simple lists of tag names or alphanumeric characters - $var = explode(',',$var); + $var = explode(',', $var); } else { $var = preg_split('/(,|[\n\r]+)/', $var); } // remove spaces - foreach ($var as $i => $j) $var[$i] = trim($j); + foreach ($var as $i => $j) { + $var[$i] = trim($j); + } if ($type === self::HASH) { // key:value,key2:value2 $nvar = array(); foreach ($var as $keypair) { $c = explode(':', $keypair, 2); - if (!isset($c[1])) continue; + if (!isset($c[1])) { + continue; + } $nvar[trim($c[0])] = trim($c[1]); } $var = $nvar; } } - if (!is_array($var)) break; + if (!is_array($var)) { + break; + } $keys = array_keys($var); if ($keys === array_keys($keys)) { - if ($type == self::ALIST) return $var; - elseif ($type == self::LOOKUP) { + if ($type == self::ALIST) { + return $var; + } elseif ($type == self::LOOKUP) { $new = array(); foreach ($var as $key) { $new[$key] = true; } return $new; - } else break; + } else { + break; + } } if ($type === self::ALIST) { trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); @@ -86,7 +110,11 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser if ($type === self::LOOKUP) { foreach ($var as $key => $value) { if ($value !== true) { - trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING); + trigger_error( + "Lookup array has non-true value at key '$key'; " . + "maybe your input array was not indexed numerically", + E_USER_WARNING + ); } $var[$key] = true; } @@ -97,7 +125,6 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser } $this->errorGeneric($var, $type); } - } // vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Native.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Native.php similarity index 67% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Native.php rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Native.php index b02a6de54..f11c318ef 100644 --- a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParser/Native.php +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParser/Native.php @@ -8,11 +8,24 @@ class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser { - protected function parseImplementation($var, $type, $allow_null) { + /** + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return null|string + */ + protected function parseImplementation($var, $type, $allow_null) + { return $this->evalExpression($var); } - protected function evalExpression($expr) { + /** + * @param string $expr + * @return mixed + * @throws HTMLPurifier_VarParserException + */ + protected function evalExpression($expr) + { $var = null; $result = eval("\$var = $expr;"); if ($result === false) { @@ -20,7 +33,6 @@ class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser } return $var; } - } // vim: et sw=4 sts=4 diff --git a/library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParserException.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParserException.php similarity index 100% rename from library/vendor/htmlpurifier-4.5.0-lite/library/HTMLPurifier/VarParserException.php rename to library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/VarParserException.php diff --git a/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Zipper.php b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Zipper.php new file mode 100644 index 000000000..6e21ea070 --- /dev/null +++ b/library/vendor/htmlpurifier-4.6.0-lite/library/HTMLPurifier/Zipper.php @@ -0,0 +1,157 @@ +front = $front; + $this->back = $back; + } + + /** + * Creates a zipper from an array, with a hole in the + * 0-index position. + * @param Array to zipper-ify. + * @return Tuple of zipper and element of first position. + */ + static public function fromArray($array) { + $z = new self(array(), array_reverse($array)); + $t = $z->delete(); // delete the "dummy hole" + return array($z, $t); + } + + /** + * Convert zipper back into a normal array, optionally filling in + * the hole with a value. (Usually you should supply a $t, unless you + * are at the end of the array.) + */ + public function toArray($t = NULL) { + $a = $this->front; + if ($t !== NULL) $a[] = $t; + for ($i = count($this->back)-1; $i >= 0; $i--) { + $a[] = $this->back[$i]; + } + return $a; + } + + /** + * Move hole to the next element. + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function next($t) { + if ($t !== NULL) array_push($this->front, $t); + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Iterated hole advancement. + * @param $t Element to fill hole with + * @param $i How many forward to advance hole + * @return Original contents of new hole, i away + */ + public function advance($t, $n) { + for ($i = 0; $i < $n; $i++) { + $t = $this->next($t); + } + return $t; + } + + /** + * Move hole to the previous element + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function prev($t) { + if ($t !== NULL) array_push($this->back, $t); + return empty($this->front) ? NULL : array_pop($this->front); + } + + /** + * Delete contents of current hole, shifting hole to + * next element. + * @return Original contents of new hole. + */ + public function delete() { + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Returns true if we are at the end of the list. + * @return bool + */ + public function done() { + return empty($this->back); + } + + /** + * Insert element before hole. + * @param Element to insert + */ + public function insertBefore($t) { + if ($t !== NULL) array_push($this->front, $t); + } + + /** + * Insert element after hole. + * @param Element to insert + */ + public function insertAfter($t) { + if ($t !== NULL) array_push($this->back, $t); + } + + /** + * Splice in multiple elements at hole. Functional specification + * in terms of array_splice: + * + * $arr1 = $arr; + * $old1 = array_splice($arr1, $i, $delete, $replacement); + * + * list($z, $t) = HTMLPurifier_Zipper::fromArray($arr); + * $t = $z->advance($t, $i); + * list($old2, $t) = $z->splice($t, $delete, $replacement); + * $arr2 = $z->toArray($t); + * + * assert($old1 === $old2); + * assert($arr1 === $arr2); + * + * NB: the absolute index location after this operation is + * *unchanged!* + * + * @param Current contents of hole. + */ + public function splice($t, $delete, $replacement) { + // delete + $old = array(); + $r = $t; + for ($i = $delete; $i > 0; $i--) { + $old[] = $r; + $r = $this->delete(); + } + // insert + for ($i = count($replacement)-1; $i >= 0; $i--) { + $this->insertAfter($r); + $r = $replacement[$i]; + } + return array($old, $r); + } +} diff --git a/library/vendor/lessphp/README.md b/library/vendor/lessphp/README.md deleted file mode 100644 index 0085e19d9..000000000 --- a/library/vendor/lessphp/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# lessphp v0.3.9 -###