Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-04 18:45:52 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-04 18:45:52 +0300
commit59941c251ee2a1be5283d7817ff623fba40a94e4 (patch)
tree8193272daa08ec3f09d31d8f66bcaf42ee5fe0e5 /lib/TokenManager.php
parentf93a2d2e80618ba51b4ba8d5de0d820a4097b634 (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.php7
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');
}