N°4913 - Avoid object initials to overflow in medallions

This commit is contained in:
Molkobain
2022-03-06 22:43:10 +01:00
parent e3586cff65
commit cd7f9e478f
6 changed files with 53 additions and 5 deletions

View File

@@ -3050,6 +3050,20 @@ HTML;
return $aMentionedObjects;
}
/**
* Note: This method is not ideal, but other solutions seemed even less ideal:
* * Add a "$sMaxLength" param. to utils::ToAcronym(): Does not work for every use cases (see corresponding ticket) as in some parts utils::ToAcronym isn't necessarly meant to be used in a medallion.
*
* @param string $sInitials
*
* @return string Truncates $sInitials so it can fit in medallions
* @since 3.0.1 N°4913
*/
public static function FormatInitialsForMedallion(string $sInitials): string
{
return mb_substr($sInitials, 0, 3);
}
/**
* @param $sUrl
* @param string $sParamName