fix: replace mb_strlen/mb_substr with strlen/substr — mbstring not available on prod

This commit is contained in:
Pontoporeia
2026-04-08 17:42:01 +02:00
parent 9eec5d3ac0
commit 7117934d07
4 changed files with 6 additions and 50 deletions

View File

@@ -185,7 +185,7 @@ class Parsedown
while (($beforeTab = strstr($line, "\t", true)) !== false)
{
$shortage = 4 - mb_strlen($beforeTab, 'utf-8') % 4;
$shortage = 4 - strlen($beforeTab) % 4;
$line = $beforeTab
. str_repeat(' ', $shortage)

View File

@@ -211,7 +211,7 @@ class SearchController
$out = [];
foreach ($raw as $v) {
$v = trim((string)$v);
if ($v !== '' && mb_strlen($v) <= $maxLen) {
if ($v !== '' && strlen($v) <= $maxLen) {
$out[] = $v;
}
}

View File

@@ -126,8 +126,8 @@ class TfeController
return 'Mémoire de fin d\'études Posterg, répertoire des TFE de l\'erg.';
}
return mb_strlen($plain) > self::META_MAX_LEN
? mb_substr($plain, 0, self::META_MAX_LEN - 3) . '…'
return strlen($plain) > self::META_MAX_LEN
? substr($plain, 0, self::META_MAX_LEN - 3) . '…'
: $plain;
}