MDL-76412 lib: Fixed PHP 8.2 utf8_encode deprecations tinymce

This commit is contained in:
raortegar 2023-01-31 15:21:01 +01:00
parent 1ea152c99a
commit dc51096889
2 changed files with 3 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class PSpellShell extends SpellChecker {
preg_match("/(\&|#) ([^ ]+) .*/i", $dstr, $matches);
if (!empty($matches[2]))
$returnData[] = utf8_encode(trim($matches[2]));
$returnData[] = mb_convert_encoding(trim($matches[2]), 'UTF-8', 'ISO-8859-1');
}
return $returnData;
@ -60,10 +60,7 @@ class PSpellShell extends SpellChecker {
function &getSuggestions($lang, $word) {
$cmd = $this->_getCMD($lang);
if (function_exists("mb_convert_encoding"))
$word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8"));
else
$word = utf8_encode($word);
$word = mb_convert_encoding($word, 'ISO-8859-1', 'UTF-8');
if ($fh = fopen($this->_tmpfile, "w")) {
fwrite($fh, "!\n");

View File

@ -9,3 +9,4 @@ List of changes:
* MDL-25736 - French spellchecker fixes.
* Fix htmlentities conversion in GoogleSpell.php
* Constructors in Moxiecode_JSONReader, Moxiecode_JSON, Moxiecode_Logger, SpellChecker are renamed to __construct()
* MDL-76412 - Fixes for PHP 8.2: utf8_encode and utf8_decode functions deprecated