Page MenuHomePhorge

D25249.1737346205.diff
No OneTemporary

D25249.1737346205.diff

diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -718,7 +718,17 @@
'mbstring'));
}
- $result = @mb_convert_encoding($string, $to_encoding, $from_encoding);
+ $available_encodings = mb_list_encodings();
+ foreach ($available_encodings as $enc) {
+ $available_encodings = array_merge($available_encodings, mb_encoding_aliases($enc));
+ }
+ $available_encodings = array_change_key_case(array_fill_keys($available_encodings, true));
+ $to_encoding_is_valid = array_key_exists(strtolower($to_encoding), $available_encodings);
+ if ($to_encoding_is_valid) {
+ $result = @mb_convert_encoding($string, $to_encoding, $from_encoding);
+ } else {
+ $result = false;
+ }
if ($result === false) {
$message = error_get_last();

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 20, 04:10 (1 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1135630
Default Alt Text
D25249.1737346205.diff (813 B)

Event Timeline