From e7521e4c133e2155b9758501fdca1a73cb46d480 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 6 Oct 2010 19:12:49 +0000 Subject: [PATCH] MDL-6122 truncate_userinfo() has to use unicode aware functions --- lib/moodlelib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 7dc96cdebfa..bf96cc516de 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3496,10 +3496,11 @@ function truncate_userinfo($info) { 'url' => 255, ); + $textlib = textlib_get_instance(); // apply where needed foreach (array_keys($info) as $key) { if (!empty($limit[$key])) { - $info[$key] = trim(substr($info[$key],0, $limit[$key])); + $info[$key] = trim($textlib->substr($info[$key],0, $limit[$key])); } } -- 2.43.0