mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Replace PHP 8.2 deprecated mb_convert_encoding() call in Sanitizer
This commit is contained in:
@@ -1671,7 +1671,7 @@ class Sanitizer extends Wire {
|
|||||||
'outCharset' => 'UTF-8', // output charset
|
'outCharset' => 'UTF-8', // output charset
|
||||||
'truncateTail' => true, // if truncate necessary for maxLength, remove chars from tail? False to truncate from head.
|
'truncateTail' => true, // if truncate necessary for maxLength, remove chars from tail? False to truncate from head.
|
||||||
'trim' => true, // trim whitespace from beginning/end, or specify character(s) to trim, or false to disable
|
'trim' => true, // trim whitespace from beginning/end, or specify character(s) to trim, or false to disable
|
||||||
);
|
);
|
||||||
|
|
||||||
static $alwaysReplace = null;
|
static $alwaysReplace = null;
|
||||||
$truncated = false;
|
$truncated = false;
|
||||||
@@ -1682,13 +1682,9 @@ class Sanitizer extends Wire {
|
|||||||
if($options['maxBytes'] < 0) $options['maxBytes'] = 0;
|
if($options['maxBytes'] < 0) $options['maxBytes'] = 0;
|
||||||
|
|
||||||
if($alwaysReplace === null) {
|
if($alwaysReplace === null) {
|
||||||
if($this->multibyteSupport) {
|
$alwaysReplace = array(
|
||||||
$alwaysReplace = array(
|
html_entity_decode('
', ENT_QUOTES, 'UTF-8') => '', // line-seperator that is sometimes copy/pasted
|
||||||
mb_convert_encoding('
', 'UTF-8', 'HTML-ENTITIES') => '', // line-seperator that is sometimes copy/pasted
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$alwaysReplace = array();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($options['reduceSpace'] !== false && $options['stripSpace'] === false) {
|
if($options['reduceSpace'] !== false && $options['stripSpace'] === false) {
|
||||||
|
Reference in New Issue
Block a user