Skip to content

Commit

Permalink
use mb function for bio in reference provider
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Nov 29, 2024
1 parent b30830e commit b065024
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Reference/ProfilePickerReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ public function resolveReference(string $referenceText): ?IReference {
'title' => $userDisplayName,
'subline' => $userEmail ?? $userDisplayName,
'email' => $userEmail,
'bio' => isset($bio) && $bio !== '' ? substr_replace($bio, '...', 80, strlen($bio)) : null,
'bio' => isset($bio) && $bio !== ''
? (mb_strlen($bio) > 80
? (mb_substr($bio, 0, 80) . '...')
: $bio)
: null,
'headline' => $headline->getScope() !== IAccountManager::SCOPE_PRIVATE ? $headline->getValue() : null,
'location' => $location->getScope() !== IAccountManager::SCOPE_PRIVATE ? $location->getValue() : null,
'location_url' => $location->getScope() !== IAccountManager::SCOPE_PRIVATE ? $this->getOpenStreetLocationUrl($location->getValue()) : null,
Expand Down

0 comments on commit b065024

Please sign in to comment.