From e426273cb2eb861b63e510c43c332bc4d1e925d1 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 27 Aug 2020 09:37:22 +1200 Subject: [PATCH] Prevent langauge translation issues with acronym. Should not be more than 2chars. --- db/install.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/db/install.php b/db/install.php index 4bcb19a..43b5565 100644 --- a/db/install.php +++ b/db/install.php @@ -36,6 +36,10 @@ function xmldb_attendance_install() { $rec = new stdClass; $rec->attendanceid = 0; $rec->acronym = get_string($k.'acronym', 'attendance'); + // Sanity check - if language translation uses more than the allowed 2 chars. + if (mb_strlen($rec->acronym) > 2) { + $rec->acronym = $k; + } $rec->description = get_string($k.'full', 'attendance'); $rec->grade = $v; $rec->visible = 1;