Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -22,10 +22,8 @@ class DomHandler extends Handler
/**
* List of all MIME types that may
* be used in data URIs
*
* @var array
*/
public static $allowedDataUris = [
public static array $allowedDataUris = [
'data:image/png',
'data:image/gif',
'data:image/jpg',
@@ -41,31 +39,24 @@ class DomHandler extends Handler
/**
* Allowed hostnames for HTTP(S) URLs
*
* @var array
* @var array|true
*/
public static $allowedDomains = [];
public static array|bool $allowedDomains = true;
/**
* Names of allowed XML processing instructions
*
* @var array
*/
public static $allowedPIs = [];
public static array $allowedPIs = [];
/**
* The document type (`'HTML'` or `'XML'`)
* (to be set in child classes)
*
* @var string
*/
protected static $type = 'XML';
protected static string $type = 'XML';
/**
* Sanitizes the given string
*
* @param string $string
* @return string
*
* @throws \Kirby\Exception\InvalidArgumentException If the file couldn't be parsed
*/
public static function sanitize(string $string): string
@@ -78,9 +69,6 @@ class DomHandler extends Handler
/**
* Validates file contents
*
* @param string $string
* @return void
*
* @throws \Kirby\Exception\InvalidArgumentException If the file couldn't be parsed
* @throws \Kirby\Exception\InvalidArgumentException If the file didn't pass validation
*/
@@ -98,7 +86,6 @@ class DomHandler extends Handler
* Custom callback for additional attribute sanitization
* @internal
*
* @param \DOMAttr $attr
* @return array Array with exception objects for each modification
*/
public static function sanitizeAttr(DOMAttr $attr): array
@@ -111,7 +98,6 @@ class DomHandler extends Handler
* Custom callback for additional element sanitization
* @internal
*
* @param \DOMElement $element
* @return array Array with exception objects for each modification
*/
public static function sanitizeElement(DOMElement $element): array
@@ -123,9 +109,6 @@ class DomHandler extends Handler
/**
* Custom callback for additional doctype validation
* @internal
*
* @param \DOMDocumentType $doctype
* @return void
*/
public static function validateDoctype(DOMDocumentType $doctype): void
{
@@ -135,8 +118,6 @@ class DomHandler extends Handler
/**
* Returns the sanitization options for the handler
* (to be extended in child classes)
*
* @return array
*/
protected static function options(): array
{
@@ -153,12 +134,9 @@ class DomHandler extends Handler
/**
* Parses the given string into a `Toolkit\Dom` object
*
* @param string $string
* @return \Kirby\Toolkit\Dom
*
* @throws \Kirby\Exception\InvalidArgumentException If the file couldn't be parsed
*/
protected static function parse(string $string)
protected static function parse(string $string): Dom
{
return new Dom($string, static::$type);
}