Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2695614
D25249.1734850316.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
652 B
Referenced Files
None
Subscribers
None
D25249.1734850316.diff
View Options
diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -718,13 +718,10 @@
'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",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 06:51 (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1025465
Default Alt Text
D25249.1734850316.diff (652 B)
Attached To
Mode
D25249: Fix PHP 8.0 ValueError calling mb_convert_encoding() with an invalid encoding
Attached
Detach File
Event Timeline
Log In to Comment