From 6603cbf099d90eb81cc548a3189bb20223425e84 Mon Sep 17 00:00:00 2001 From: Toshik Date: Fri, 18 Sep 2015 13:12:25 +0300 Subject: [PATCH] String cutting should support multibyte (UTF-8) --- pages/quest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/quest.php b/pages/quest.php index eec62ee4..f152cb04 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -265,7 +265,7 @@ class QuestPage extends GenericPage 'side' => Util::sideByRaceMask($_['reqRaceMask']), 'typeStr' => Util::$typeStrings[TYPE_QUEST], 'typeId' => $_['typeId'], - 'name' => strlen($n) > 40 ? substr($n, 0, 40).'…' : $n + 'name' => mb_strlen($n) > 40 ? mb_substr($n, 0, 40).'…' : $n ) )); } @@ -282,7 +282,7 @@ class QuestPage extends GenericPage 'side' => Util::sideByRaceMask($_['reqRaceMask']), 'typeStr' => Util::$typeStrings[TYPE_QUEST], 'typeId' => $_['typeId'], - 'name' => strlen($n) > 40 ? substr($n, 0, 40).'…' : $n, + 'name' => mb_strlen($n) > 40 ? mb_substr($n, 0, 40).'…' : $n, '_next' => $_['_next'], ) )); @@ -308,7 +308,7 @@ class QuestPage extends GenericPage 'side' => Util::sideByRaceMask($list->getField('reqRaceMask')), 'typeStr' => Util::$typeStrings[TYPE_QUEST], 'typeId' => $id, - 'name' => strlen($n) > 40 ? substr($n, 0, 40).'…' : $n + 'name' => mb_strlen($n) > 40 ? mb_substr($n, 0, 40).'…' : $n )); }