提交的内容
This commit is contained in:
6
vendor/ezyang/htmlpurifier/CHANGELOG.md
vendored
6
vendor/ezyang/htmlpurifier/CHANGELOG.md
vendored
@ -1,6 +0,0 @@
|
||||
# [4.16.0](https://github.com/ezyang/htmlpurifier/compare/v4.15.0...v4.16.0) (2022-09-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add semantic release ([#307](https://github.com/ezyang/htmlpurifier/issues/307)) ([db31243](https://github.com/ezyang/htmlpurifier/commit/db312435cb9d8d73395f75f9642a43ba6de5e903)), closes [#322](https://github.com/ezyang/htmlpurifier/issues/322) [#323](https://github.com/ezyang/htmlpurifier/issues/323) [#326](https://github.com/ezyang/htmlpurifier/issues/326) [#327](https://github.com/ezyang/htmlpurifier/issues/327) [#328](https://github.com/ezyang/htmlpurifier/issues/328) [#329](https://github.com/ezyang/htmlpurifier/issues/329) [#330](https://github.com/ezyang/htmlpurifier/issues/330) [#331](https://github.com/ezyang/htmlpurifier/issues/331) [#332](https://github.com/ezyang/htmlpurifier/issues/332) [#333](https://github.com/ezyang/htmlpurifier/issues/333) [#337](https://github.com/ezyang/htmlpurifier/issues/337) [#335](https://github.com/ezyang/htmlpurifier/issues/335) [ezyang/htmlpurifier#334](https://github.com/ezyang/htmlpurifier/issues/334) [#336](https://github.com/ezyang/htmlpurifier/issues/336) [#338](https://github.com/ezyang/htmlpurifier/issues/338)
|
||||
0
vendor/ezyang/htmlpurifier/CREDITS
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/CREDITS
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/LICENSE
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/LICENSE
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/README.md
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/README.md
vendored
Executable file → Normal file
2
vendor/ezyang/htmlpurifier/VERSION
vendored
Executable file → Normal file
2
vendor/ezyang/htmlpurifier/VERSION
vendored
Executable file → Normal file
@ -1 +1 @@
|
||||
4.15.0
|
||||
4.18.0
|
||||
5
vendor/ezyang/htmlpurifier/composer.json
vendored
Executable file → Normal file
5
vendor/ezyang/htmlpurifier/composer.json
vendored
Executable file → Normal file
@ -13,7 +13,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
|
||||
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"cerdic/css-tidy": "^1.7 || ^2.0",
|
||||
@ -38,7 +38,8 @@
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/ezyang/simpletest.git"
|
||||
"url": "https://github.com/ezyang/simpletest.git",
|
||||
"no-api": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload-legacy.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload-legacy.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php
vendored
Executable file → Normal file
3
vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
vendored
Executable file → Normal file
3
vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
vendored
Executable file → Normal file
@ -7,7 +7,7 @@
|
||||
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
|
||||
* FILE, changes will be overwritten the next time the script is run.
|
||||
*
|
||||
* @version 4.15.0
|
||||
* @version 4.18.0
|
||||
*
|
||||
* @warning
|
||||
* You must *not* include any other HTML Purifier files before this file,
|
||||
@ -101,6 +101,7 @@ require 'HTMLPurifier/AttrDef/CSS/Length.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/ListStyle.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/Multiple.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/Percentage.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/Ratio.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/TextDecoration.php';
|
||||
require 'HTMLPurifier/AttrDef/CSS/URI.php';
|
||||
require 'HTMLPurifier/AttrDef/HTML/Bool.php';
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php
vendored
Executable file → Normal file
6
vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
vendored
Executable file → Normal file
6
vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
vendored
Executable file → Normal file
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
HTML Purifier 4.15.0 - Standards Compliant HTML Filtering
|
||||
HTML Purifier 4.18.0 - Standards Compliant HTML Filtering
|
||||
Copyright (C) 2006-2008 Edward Z. Yang
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
@ -58,12 +58,12 @@ class HTMLPurifier
|
||||
* Version of HTML Purifier.
|
||||
* @type string
|
||||
*/
|
||||
public $version = '4.15.0';
|
||||
public $version = '4.18.0';
|
||||
|
||||
/**
|
||||
* Constant with version of HTML Purifier.
|
||||
*/
|
||||
const VERSION = '4.15.0';
|
||||
const VERSION = '4.18.0';
|
||||
|
||||
/**
|
||||
* Global configuration object.
|
||||
|
||||
1
vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
vendored
Executable file → Normal file
1
vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
vendored
Executable file → Normal file
@ -95,6 +95,7 @@ require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Ratio.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
|
||||
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php
vendored
Executable file → Normal file
14
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
vendored
Executable file → Normal file
14
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
vendored
Executable file → Normal file
@ -27,6 +27,13 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
|
||||
$definition = $config->getCSSDefinition();
|
||||
$allow_duplicates = $config->get("CSS.AllowDuplicates");
|
||||
|
||||
$universal_attrdef = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
'initial',
|
||||
'inherit',
|
||||
'unset',
|
||||
)
|
||||
);
|
||||
|
||||
// According to the CSS2.1 spec, the places where a
|
||||
// non-delimiting semicolon can appear are in strings
|
||||
@ -96,16 +103,13 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
|
||||
if (!$ok) {
|
||||
continue;
|
||||
}
|
||||
// inefficient call, since the validator will do this again
|
||||
if (strtolower(trim($value)) !== 'inherit') {
|
||||
// inherit works for everything (but only on the base property)
|
||||
$result = $universal_attrdef->validate($value, $config, $context);
|
||||
if ($result === false) {
|
||||
$result = $definition->info[$property]->validate(
|
||||
$value,
|
||||
$config,
|
||||
$context
|
||||
);
|
||||
} else {
|
||||
$result = 'inherit';
|
||||
}
|
||||
if ($result === false) {
|
||||
continue;
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php
vendored
Executable file → Normal file
32
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
vendored
Executable file → Normal file
32
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
vendored
Executable file → Normal file
@ -10,23 +10,21 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->mask = '_- ';
|
||||
for ($c = 'a'; $c <= 'z'; $c++) {
|
||||
$this->mask .= $c;
|
||||
}
|
||||
for ($c = 'A'; $c <= 'Z'; $c++) {
|
||||
$this->mask .= $c;
|
||||
}
|
||||
for ($c = '0'; $c <= '9'; $c++) {
|
||||
$this->mask .= $c;
|
||||
} // cast-y, but should be fine
|
||||
// special bytes used by UTF-8
|
||||
for ($i = 0x80; $i <= 0xFF; $i++) {
|
||||
// We don't bother excluding invalid bytes in this range,
|
||||
// because the our restriction of well-formed UTF-8 will
|
||||
// prevent these from ever occurring.
|
||||
$this->mask .= chr($i);
|
||||
}
|
||||
// Lowercase letters
|
||||
$l = range('a', 'z');
|
||||
// Uppercase letters
|
||||
$u = range('A', 'Z');
|
||||
// Digits
|
||||
$d = range('0', '9');
|
||||
// Special bytes used by UTF-8
|
||||
$b = array_map('chr', range(0x80, 0xFF));
|
||||
// All valid characters for the mask
|
||||
$c = array_merge($l, $u, $d, $b);
|
||||
// Concatenate all valid characters into a string
|
||||
// Use '_- ' as an initial value
|
||||
$this->mask = array_reduce($c, function ($carry, $value) {
|
||||
return $carry . $value;
|
||||
}, '_- ');
|
||||
|
||||
/*
|
||||
PHP's internal strcspn implementation is
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php
vendored
Executable file → Normal file
46
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ratio.php
vendored
Normal file
46
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ratio.php
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Validates a ratio as defined by the CSS spec.
|
||||
*/
|
||||
class HTMLPurifier_AttrDef_CSS_Ratio extends HTMLPurifier_AttrDef
|
||||
{
|
||||
/**
|
||||
* @param string $ratio Ratio to validate
|
||||
* @param HTMLPurifier_Config $config Configuration options
|
||||
* @param HTMLPurifier_Context $context Context
|
||||
*
|
||||
* @return string|boolean
|
||||
*
|
||||
* @warning Some contexts do not pass $config, $context. These
|
||||
* variables should not be used without checking HTMLPurifier_Length
|
||||
*/
|
||||
public function validate($ratio, $config, $context)
|
||||
{
|
||||
$ratio = $this->parseCDATA($ratio);
|
||||
|
||||
$parts = explode('/', $ratio, 2);
|
||||
$length = count($parts);
|
||||
|
||||
if ($length < 1 || $length > 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$num = new \HTMLPurifier_AttrDef_CSS_Number();
|
||||
|
||||
if ($length === 1) {
|
||||
return $num->validate($parts[0], $config, $context);
|
||||
}
|
||||
|
||||
$num1 = $num->validate($parts[0], $config, $context);
|
||||
$num2 = $num->validate($parts[1], $config, $context);
|
||||
|
||||
if ($num1 === false || $num2 === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $num1 . '/' . $num2;
|
||||
}
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
vendored
Executable file → Normal file
20
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
vendored
Executable file → Normal file
20
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
vendored
Executable file → Normal file
@ -63,24 +63,18 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
|
||||
// This doesn't match I18N domain names, but we don't have proper IRI support,
|
||||
// so force users to insert Punycode.
|
||||
|
||||
// There is not a good sense in which underscores should be
|
||||
// allowed, since it's technically not! (And if you go as
|
||||
// far to allow everything as specified by the DNS spec...
|
||||
// well, that's literally everything, modulo some space limits
|
||||
// for the components and the overall name (which, by the way,
|
||||
// we are NOT checking!). So we (arbitrarily) decide this:
|
||||
// let's allow underscores wherever we would have allowed
|
||||
// hyphens, if they are enabled. This is a pretty good match
|
||||
// for browser behavior, for example, a large number of browsers
|
||||
// cannot handle foo_.example.com, but foo_bar.example.com is
|
||||
// fairly well supported.
|
||||
// Underscores defined as Unreserved Characters in RFC 3986 are
|
||||
// allowed in a URI. There are cases where we want to consider a
|
||||
// URI containing "_" such as "_dmarc.example.com".
|
||||
// Underscores are not allowed in the default. If you want to
|
||||
// allow it, set Core.AllowHostnameUnderscore to true.
|
||||
$underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : '';
|
||||
|
||||
// Based off of RFC 1738, but amended so that
|
||||
// as per RFC 3696, the top label need only not be all numeric.
|
||||
// The productions describing this are:
|
||||
$a = '[a-z]'; // alpha
|
||||
$an = '[a-z0-9]'; // alphanum
|
||||
$an = "[a-z0-9$underscore]"; // alphanum
|
||||
$and = "[a-z0-9-$underscore]"; // alphanum | "-"
|
||||
// domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
|
||||
$domainlabel = "$an(?:$and*$an)?";
|
||||
@ -106,7 +100,7 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
|
||||
// If we have Net_IDNA2 support, we can support IRIs by
|
||||
// punycoding them. (This is the most portable thing to do,
|
||||
// since otherwise we have to assume browsers support
|
||||
} elseif ($config->get('Core.EnableIDNA')) {
|
||||
} elseif ($config->get('Core.EnableIDNA') && class_exists('Net_IDNA2')) {
|
||||
$idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true));
|
||||
// we need to encode each period separately
|
||||
$parts = explode('.', $string);
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php
vendored
Executable file → Normal file
6
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php
vendored
Executable file → Normal file
6
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php
vendored
Executable file → Normal file
@ -33,7 +33,11 @@ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform
|
||||
|
||||
// XXX Kind of inefficient
|
||||
$url = $this->parser->parse($attr['href']);
|
||||
$scheme = $url->getSchemeObj($config, $context);
|
||||
|
||||
// Ignore invalid schemes (e.g. `javascript:`)
|
||||
if (!($scheme = $url->getSchemeObj($config, $context))) {
|
||||
return $attr;
|
||||
}
|
||||
|
||||
if ($scheme->browsable && !$url->isBenign($config, $context)) {
|
||||
$attr['target'] = '_blank';
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoreferrer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoreferrer.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php
vendored
Executable file → Normal file
41
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
vendored
Executable file → Normal file
41
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
vendored
Executable file → Normal file
@ -79,44 +79,11 @@ class HTMLPurifier_Bootstrap
|
||||
public static function registerAutoload()
|
||||
{
|
||||
$autoload = array('HTMLPurifier_Bootstrap', 'autoload');
|
||||
if (($funcs = spl_autoload_functions()) === false) {
|
||||
if (spl_autoload_functions() === false) {
|
||||
spl_autoload_register($autoload);
|
||||
} elseif (function_exists('spl_autoload_unregister')) {
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
// prepend flag exists, no need for shenanigans
|
||||
spl_autoload_register($autoload, true, true);
|
||||
} else {
|
||||
$buggy = version_compare(PHP_VERSION, '5.2.11', '<');
|
||||
$compat = version_compare(PHP_VERSION, '5.1.2', '<=') &&
|
||||
version_compare(PHP_VERSION, '5.1.0', '>=');
|
||||
foreach ($funcs as $func) {
|
||||
if ($buggy && is_array($func)) {
|
||||
// :TRICKY: There are some compatibility issues and some
|
||||
// places where we need to error out
|
||||
$reflector = new ReflectionMethod($func[0], $func[1]);
|
||||
if (!$reflector->isStatic()) {
|
||||
throw new Exception(
|
||||
'HTML Purifier autoloader registrar is not compatible
|
||||
with non-static object methods due to PHP Bug #44144;
|
||||
Please do not use HTMLPurifier.autoload.php (or any
|
||||
file that includes this file); instead, place the code:
|
||||
spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\'))
|
||||
after your own autoloaders.'
|
||||
);
|
||||
}
|
||||
// Suprisingly, spl_autoload_register supports the
|
||||
// Class::staticMethod callback format, although call_user_func doesn't
|
||||
if ($compat) {
|
||||
$func = implode('::', $func);
|
||||
}
|
||||
}
|
||||
spl_autoload_unregister($func);
|
||||
}
|
||||
spl_autoload_register($autoload);
|
||||
foreach ($funcs as $func) {
|
||||
spl_autoload_register($func);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// prepend flag exists, no need for shenanigans
|
||||
spl_autoload_register($autoload, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
208
vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
vendored
Executable file → Normal file
208
vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
vendored
Executable file → Normal file
@ -13,7 +13,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
* Assoc array of attribute name to definition object.
|
||||
* @type HTMLPurifier_AttrDef[]
|
||||
*/
|
||||
public $info = array();
|
||||
public $info = [];
|
||||
|
||||
/**
|
||||
* Constructs the info array. The meat of this class.
|
||||
@ -22,7 +22,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
protected function doSetup($config)
|
||||
{
|
||||
$this->info['text-align'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('left', 'right', 'center', 'justify'),
|
||||
['left', 'right', 'center', 'justify'],
|
||||
false
|
||||
);
|
||||
|
||||
@ -31,7 +31,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['border-right-style'] =
|
||||
$this->info['border-left-style'] =
|
||||
$this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'none',
|
||||
'hidden',
|
||||
'dotted',
|
||||
@ -42,42 +42,42 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'ridge',
|
||||
'inset',
|
||||
'outset'
|
||||
),
|
||||
],
|
||||
false
|
||||
);
|
||||
|
||||
$this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style);
|
||||
|
||||
$this->info['clear'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('none', 'left', 'right', 'both'),
|
||||
['none', 'left', 'right', 'both'],
|
||||
false
|
||||
);
|
||||
$this->info['float'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('none', 'left', 'right'),
|
||||
['none', 'left', 'right'],
|
||||
false
|
||||
);
|
||||
$this->info['font-style'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('normal', 'italic', 'oblique'),
|
||||
['normal', 'italic', 'oblique'],
|
||||
false
|
||||
);
|
||||
$this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('normal', 'small-caps'),
|
||||
['normal', 'small-caps'],
|
||||
false
|
||||
);
|
||||
|
||||
$uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('none')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['none']),
|
||||
new HTMLPurifier_AttrDef_CSS_URI()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('inside', 'outside'),
|
||||
['inside', 'outside'],
|
||||
false
|
||||
);
|
||||
$this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'disc',
|
||||
'circle',
|
||||
'square',
|
||||
@ -87,7 +87,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'lower-alpha',
|
||||
'upper-alpha',
|
||||
'none'
|
||||
),
|
||||
],
|
||||
false
|
||||
);
|
||||
$this->info['list-style-image'] = $uri_or_none;
|
||||
@ -95,34 +95,32 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config);
|
||||
|
||||
$this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('capitalize', 'uppercase', 'lowercase', 'none'),
|
||||
['capitalize', 'uppercase', 'lowercase', 'none'],
|
||||
false
|
||||
);
|
||||
$this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color();
|
||||
|
||||
$this->info['background-image'] = $uri_or_none;
|
||||
$this->info['background-repeat'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('repeat', 'repeat-x', 'repeat-y', 'no-repeat')
|
||||
['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
|
||||
);
|
||||
$this->info['background-attachment'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('scroll', 'fixed')
|
||||
['scroll', 'fixed']
|
||||
);
|
||||
$this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
|
||||
|
||||
$this->info['background-size'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'auto',
|
||||
'cover',
|
||||
'contain',
|
||||
'initial',
|
||||
'inherit',
|
||||
)
|
||||
]
|
||||
),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(),
|
||||
new HTMLPurifier_AttrDef_CSS_Length()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$border_color =
|
||||
@ -131,10 +129,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['border-left-color'] =
|
||||
$this->info['border-right-color'] =
|
||||
$this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('transparent')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['transparent']),
|
||||
new HTMLPurifier_AttrDef_CSS_Color()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config);
|
||||
@ -146,32 +144,32 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['border-bottom-width'] =
|
||||
$this->info['border-left-width'] =
|
||||
$this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['thin', 'medium', 'thick']),
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width);
|
||||
|
||||
$this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('normal')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['normal']),
|
||||
new HTMLPurifier_AttrDef_CSS_Length()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('normal')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['normal']),
|
||||
new HTMLPurifier_AttrDef_CSS_Length()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'xx-small',
|
||||
'x-small',
|
||||
'small',
|
||||
@ -181,20 +179,20 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'xx-large',
|
||||
'larger',
|
||||
'smaller'
|
||||
)
|
||||
]
|
||||
),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(),
|
||||
new HTMLPurifier_AttrDef_CSS_Length()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_Enum(array('normal')),
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(['normal']),
|
||||
new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$margin =
|
||||
@ -202,11 +200,11 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['margin-bottom'] =
|
||||
$this->info['margin-left'] =
|
||||
$this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length(),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(),
|
||||
new HTMLPurifier_AttrDef_Enum(array('auto'))
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['auto'])
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin);
|
||||
@ -217,41 +215,40 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['padding-bottom'] =
|
||||
$this->info['padding-left'] =
|
||||
$this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding);
|
||||
|
||||
$this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length(),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true),
|
||||
new HTMLPurifier_AttrDef_Enum(array('auto', 'initial', 'inherit'))
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['auto'])
|
||||
]
|
||||
);
|
||||
$trusted_min_wh = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true),
|
||||
new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
|
||||
)
|
||||
]
|
||||
);
|
||||
$trusted_max_wh = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0'),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true),
|
||||
new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['none'])
|
||||
]
|
||||
);
|
||||
$max = $config->get('CSS.MaxImgLength');
|
||||
|
||||
@ -263,10 +260,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'img',
|
||||
// For img tags:
|
||||
new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
|
||||
new HTMLPurifier_AttrDef_Enum(array('auto'))
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['auto'])
|
||||
]
|
||||
),
|
||||
// For everyone else:
|
||||
$trusted_wh
|
||||
@ -278,12 +275,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
new HTMLPurifier_AttrDef_Switch(
|
||||
'img',
|
||||
// For img tags:
|
||||
new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
|
||||
new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
|
||||
)
|
||||
),
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
|
||||
// For everyone else:
|
||||
$trusted_min_wh
|
||||
);
|
||||
@ -295,22 +287,46 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'img',
|
||||
// For img tags:
|
||||
new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
|
||||
new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['none'])
|
||||
]
|
||||
),
|
||||
// For everyone else:
|
||||
$trusted_max_wh
|
||||
);
|
||||
|
||||
$this->info['aspect-ratio'] = new HTMLPurifier_AttrDef_CSS_Multiple(
|
||||
new HTMLPurifier_AttrDef_CSS_Composite([
|
||||
new HTMLPurifier_AttrDef_CSS_Ratio(),
|
||||
new HTMLPurifier_AttrDef_Enum(['auto']),
|
||||
])
|
||||
);
|
||||
|
||||
// text-decoration and related shorthands
|
||||
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
|
||||
|
||||
$this->info['text-decoration-line'] = new HTMLPurifier_AttrDef_Enum(
|
||||
['none', 'underline', 'overline', 'line-through']
|
||||
);
|
||||
|
||||
$this->info['text-decoration-style'] = new HTMLPurifier_AttrDef_Enum(
|
||||
['solid', 'double', 'dotted', 'dashed', 'wavy']
|
||||
);
|
||||
|
||||
$this->info['text-decoration-color'] = new HTMLPurifier_AttrDef_CSS_Color();
|
||||
|
||||
$this->info['text-decoration-thickness'] = new HTMLPurifier_AttrDef_CSS_Composite([
|
||||
new HTMLPurifier_AttrDef_CSS_Length(),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(),
|
||||
new HTMLPurifier_AttrDef_Enum(['auto', 'from-font'])
|
||||
]);
|
||||
|
||||
$this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily();
|
||||
|
||||
// this could use specialized code
|
||||
$this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'normal',
|
||||
'bold',
|
||||
'bolder',
|
||||
@ -324,7 +340,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'700',
|
||||
'800',
|
||||
'900'
|
||||
),
|
||||
],
|
||||
false
|
||||
);
|
||||
|
||||
@ -340,21 +356,21 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
$this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config);
|
||||
|
||||
$this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('collapse', 'separate')
|
||||
['collapse', 'separate']
|
||||
);
|
||||
|
||||
$this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('top', 'bottom')
|
||||
['top', 'bottom']
|
||||
);
|
||||
|
||||
$this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('auto', 'fixed')
|
||||
['auto', 'fixed']
|
||||
);
|
||||
|
||||
$this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'baseline',
|
||||
'sub',
|
||||
'super',
|
||||
@ -363,11 +379,11 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'middle',
|
||||
'bottom',
|
||||
'text-bottom'
|
||||
)
|
||||
]
|
||||
),
|
||||
new HTMLPurifier_AttrDef_CSS_Length(),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage()
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2);
|
||||
@ -375,7 +391,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
// These CSS properties don't work on many browsers, but we live
|
||||
// in THE FUTURE!
|
||||
$this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line')
|
||||
['nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line']
|
||||
);
|
||||
|
||||
if ($config->get('CSS.Proprietary')) {
|
||||
@ -422,21 +438,21 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
// more CSS3
|
||||
$this->info['page-break-after'] =
|
||||
$this->info['page-break-before'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'auto',
|
||||
'always',
|
||||
'avoid',
|
||||
'left',
|
||||
'right'
|
||||
)
|
||||
]
|
||||
);
|
||||
$this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(array('auto', 'avoid'));
|
||||
$this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(['auto', 'avoid']);
|
||||
|
||||
$border_radius = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(true), // disallow negative
|
||||
new HTMLPurifier_AttrDef_CSS_Length('0') // disallow negative
|
||||
));
|
||||
]);
|
||||
|
||||
$this->info['border-top-left-radius'] =
|
||||
$this->info['border-top-right-radius'] =
|
||||
@ -453,7 +469,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
protected function doSetupTricky($config)
|
||||
{
|
||||
$this->info['display'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array(
|
||||
[
|
||||
'inline',
|
||||
'block',
|
||||
'list-item',
|
||||
@ -472,12 +488,12 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
'table-cell',
|
||||
'table-caption',
|
||||
'none'
|
||||
)
|
||||
]
|
||||
);
|
||||
$this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('visible', 'hidden', 'collapse')
|
||||
['visible', 'hidden', 'collapse']
|
||||
);
|
||||
$this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll'));
|
||||
$this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(['visible', 'hidden', 'auto', 'scroll']);
|
||||
$this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
|
||||
}
|
||||
|
||||
@ -487,23 +503,23 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
|
||||
protected function doSetupTrusted($config)
|
||||
{
|
||||
$this->info['position'] = new HTMLPurifier_AttrDef_Enum(
|
||||
array('static', 'relative', 'absolute', 'fixed')
|
||||
['static', 'relative', 'absolute', 'fixed']
|
||||
);
|
||||
$this->info['top'] =
|
||||
$this->info['left'] =
|
||||
$this->info['right'] =
|
||||
$this->info['bottom'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_CSS_Length(),
|
||||
new HTMLPurifier_AttrDef_CSS_Percentage(),
|
||||
new HTMLPurifier_AttrDef_Enum(array('auto')),
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['auto']),
|
||||
]
|
||||
);
|
||||
$this->info['z-index'] = new HTMLPurifier_AttrDef_CSS_Composite(
|
||||
array(
|
||||
[
|
||||
new HTMLPurifier_AttrDef_Integer(),
|
||||
new HTMLPurifier_AttrDef_Enum(array('auto')),
|
||||
)
|
||||
new HTMLPurifier_AttrDef_Enum(['auto']),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php
vendored
Executable file → Normal file
0
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php
vendored
Executable file → Normal file
3
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
vendored
Executable file → Normal file
3
vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
vendored
Executable file → Normal file
@ -190,6 +190,9 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
|
||||
$current_tr_tbody = null;
|
||||
|
||||
foreach($content as $node) {
|
||||
if (!isset($node->name)) {
|
||||
continue;
|
||||
}
|
||||
switch ($node->name) {
|
||||
case 'tbody':
|
||||
$current_tr_tbody = null;
|
||||
|
||||
2
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
vendored
Executable file → Normal file
2
vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
vendored
Executable file → Normal file
@ -21,7 +21,7 @@ class HTMLPurifier_Config
|
||||
* HTML Purifier's version
|
||||
* @type string
|
||||
*/
|
||||
public $version = '4.15.0';
|
||||
public $version = '4.18.0';
|
||||
|
||||
/**
|
||||
* Whether or not to automatically finalize
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user