Upgrade to 4.3.0
This commit is contained in:
@@ -76,7 +76,7 @@ class Component
|
||||
}
|
||||
|
||||
$this->attrs = $attrs;
|
||||
$this->options = $options = $this->setup($type);
|
||||
$this->options = $options = static::setup($type);
|
||||
$this->methods = $methods = $options['methods'] ?? [];
|
||||
|
||||
foreach ($attrs as $attrName => $attrValue) {
|
||||
|
||||
@@ -464,7 +464,7 @@ class Dom
|
||||
$namespaceUri = null;
|
||||
$itemLocal = $item;
|
||||
if (Str::contains($item, ':') === true) {
|
||||
list($namespaceName, $itemLocal) = explode(':', $item);
|
||||
[$namespaceName, $itemLocal] = explode(':', $item);
|
||||
$namespaceUri = $allowedNamespaces[$namespaceName] ?? null;
|
||||
} else {
|
||||
// list items without namespace are from the default namespace
|
||||
|
||||
@@ -26,7 +26,7 @@ class Escape
|
||||
/**
|
||||
* The internal singleton escaper instance
|
||||
*/
|
||||
protected static Escaper|null $escaper;
|
||||
protected static Escaper|null $escaper = null;
|
||||
|
||||
/**
|
||||
* Escape common HTML attributes data
|
||||
|
||||
@@ -20,7 +20,7 @@ class Html extends Xml
|
||||
/**
|
||||
* An internal store for an HTML entities translation table
|
||||
*/
|
||||
public static array|null $entities;
|
||||
public static array|null $entities = null;
|
||||
|
||||
/**
|
||||
* List of HTML tags that can be used inline
|
||||
|
||||
@@ -386,10 +386,13 @@ class Str
|
||||
$encoded = '';
|
||||
|
||||
for ($i = 0; $i < static::length($string); $i++) {
|
||||
$char = static::substr($string, $i, 1);
|
||||
$char = mb_convert_encoding($char, 'UCS-4BE', 'UTF-8');
|
||||
list(, $code) = unpack('N', $char);
|
||||
$encoded .= rand(1, 2) === 1 ? '&#' . $code . ';' : '&#x' . dechex($code) . ';';
|
||||
$char = static::substr($string, $i, 1);
|
||||
$char = mb_convert_encoding($char, 'UCS-4BE', 'UTF-8');
|
||||
[, $code] = unpack('N', $char);
|
||||
$encoded .= match (random_int(1, 2)) {
|
||||
1 => '&#' . $code . ';',
|
||||
2 => '&#x' . dechex($code) . ';'
|
||||
};
|
||||
}
|
||||
|
||||
return $encoded;
|
||||
|
||||
Reference in New Issue
Block a user