mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
MDL-76412 general: Fixed PHP 8.2 utf8_encode deprecations
This commit is contained in:
parent
f6608a7e32
commit
a03e6363de
@ -39,7 +39,7 @@ if ($publickey !== false) {
|
||||
|
||||
// Encrypt data.
|
||||
$message = $CFG->release;
|
||||
$success = openssl_public_encrypt(utf8_encode($message), $encrypteddata, $publickeystr);
|
||||
$success = openssl_public_encrypt(\core_text::convert($message, 'ISO-8859-1', 'UTF-8'), $encrypteddata, $publickeystr);
|
||||
|
||||
if ($success) {
|
||||
echo base64_encode($encrypteddata);
|
||||
|
@ -1716,7 +1716,7 @@ EOD;
|
||||
if (iconv('UTF-8', 'UTF-8', $parts[$i]) == $parts[$i]) {
|
||||
$parts[$i] = rawurlencode($parts[$i]);
|
||||
} else {
|
||||
$parts[$i] = rawurlencode(utf8_encode($parts[$i]));
|
||||
$parts[$i] = rawurlencode(\core_text::convert($parts[$i], 'ISO-8859-1', 'UTF-8'));
|
||||
}
|
||||
}
|
||||
return implode('/', $parts);
|
||||
@ -1733,7 +1733,7 @@ EOD;
|
||||
$fullpath = $path;
|
||||
if (iconv('UTF-8', 'UTF-8', $fullpath) == $fullpath) {
|
||||
$this->_error_log("filename is utf-8. Needs conversion...");
|
||||
$fullpath = utf8_decode($fullpath);
|
||||
$fullpath = \core_text::convert($fullpath, 'UTF-8', 'ISO-8859-1');
|
||||
}
|
||||
return $fullpath;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user