Skip to content

Commit b065024

Browse files
committed
use mb function for bio in reference provider
Signed-off-by: Julien Veyssier <[email protected]>
1 parent b30830e commit b065024

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Reference/ProfilePickerReferenceProvider.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public function resolveReference(string $referenceText): ?IReference {
126126
'title' => $userDisplayName,
127127
'subline' => $userEmail ?? $userDisplayName,
128128
'email' => $userEmail,
129-
'bio' => isset($bio) && $bio !== '' ? substr_replace($bio, '...', 80, strlen($bio)) : null,
129+
'bio' => isset($bio) && $bio !== ''
130+
? (mb_strlen($bio) > 80
131+
? (mb_substr($bio, 0, 80) . '...')
132+
: $bio)
133+
: null,
130134
'headline' => $headline->getScope() !== IAccountManager::SCOPE_PRIVATE ? $headline->getValue() : null,
131135
'location' => $location->getScope() !== IAccountManager::SCOPE_PRIVATE ? $location->getValue() : null,
132136
'location_url' => $location->getScope() !== IAccountManager::SCOPE_PRIVATE ? $this->getOpenStreetLocationUrl($location->getValue()) : null,

0 commit comments

Comments
 (0)