diff options
author | Joas Schilling <coding@schilljs.com> | 2021-01-04 18:45:52 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-01-04 18:45:52 +0300 |
commit | 59941c251ee2a1be5283d7817ff623fba40a94e4 (patch) | |
tree | 8193272daa08ec3f09d31d8f66bcaf42ee5fe0e5 /lib/TokenManager.php | |
parent | f93a2d2e80618ba51b4ba8d5de0d820a4097b634 (diff) |
Cut of guest names so they fit into the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/TokenManager.php')
-rw-r--r-- | lib/TokenManager.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/TokenManager.php b/lib/TokenManager.php index c60cf646..fe273263 100644 --- a/lib/TokenManager.php +++ b/lib/TokenManager.php @@ -197,6 +197,13 @@ class TokenManager { if ($this->userId === null) { if ($guest_name = $this->helper->getGuestName()) { $guest_name = $this->trans->t('%s (Guest)', Util::sanitizeHTML($guest_name)); + $cut = 56; + while (mb_strlen($guest_name) >= 64) { + $guest_name = $this->trans->t('%s (Guest)', Util::sanitizeHTML( + mb_substr($guest_name, 0, $cut) + )); + $cut -= 5; + } } else { $guest_name = $this->trans->t('Anonymous guest'); } |