Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2681183
D25092.1734638275.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
646 B
Referenced Files
None
Subscribers
None
D25092.1734638275.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
@@ -288,8 +288,12 @@
* @return int The character length of the string.
*/
function phutil_utf8_strlen($string) {
- if (function_exists('utf8_decode')) {
- return strlen(utf8_decode($string));
+ if (function_exists('mb_strlen')) {
+ // Historically, this was just a call to strlen(utf8_decode($string))
+ // but, since PHP 8.2, that function is deprecated, so this is
+ // the current equivalent.
+ // https://we.phorge.it/T15188
+ return mb_strlen($string, 'UTF-8');
}
return count(phutil_utf8v($string));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 19:57 (20 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015172
Default Alt Text
D25092.1734638275.diff (646 B)
Attached To
Mode
D25092: Replace function utf8_decode() - deprecated since PHP 8.2
Attached
Detach File
Event Timeline
Log In to Comment