Page MenuHomePhorge

D25249.1737346208.diff
No OneTemporary

D25249.1737346208.diff

diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -718,20 +718,17 @@
'mbstring'));
}
- $result = @mb_convert_encoding($string, $to_encoding, $from_encoding);
-
- if ($result === false) {
- $message = error_get_last();
- if ($message) {
- $message = idx($message, 'message', pht('Unknown error.'));
+ try {
+ $result = mb_convert_encoding($string, $to_encoding, $from_encoding);
+ } catch (Throwable $ex) {
+ $message = $ex->getMessage();
+ throw new Exception(
+ pht(
+ "String conversion from encoding '%s' to encoding '%s' failed: %s",
+ $from_encoding,
+ $to_encoding,
+ $message));
}
- throw new Exception(
- pht(
- "String conversion from encoding '%s' to encoding '%s' failed: %s",
- $from_encoding,
- $to_encoding,
- $message));
- }
return $result;
}

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
1135633
Default Alt Text
D25249.1737346208.diff (954 B)

Event Timeline