Skip to content
Permalink
Browse files

Use mb_substr for menu items, names and thumbs (#4818)

  • Loading branch information...
alexserdyuk authored and DawoudIO committed May 7, 2019
1 parent 6777ab5 commit 18fcc7812ce45de3e1d9789534f6d10f72919b18
@@ -56,8 +56,8 @@ public function setIcon($icon)
public function getName()
{
if (strlen($this->name) > $this->maxNameStr) {
return substr($this->name, 0, $this->maxNameStr - 3) . " ...";
if (mb_strlen($this->name) > $this->maxNameStr) {
return mb_substr($this->name, 0, $this->maxNameStr - 3) . " ...";
}
return $this->name;
}
@@ -230,7 +230,7 @@ public function DrawAttendanceCalendar($nameX, $yTop, $aNames, $tTitle, $extraLi
}
if (date('n', $dWhichSunday) != $whichMonth) { // Finish the previous month
$this->WriteAt($monthX, $yMonths + 1, substr(gettext(date('F', $dWhichMonthDate)),0,3));
$this->WriteAt($monthX, $yMonths + 1, mb_substr(gettext(date('F', $dWhichMonthDate)),0,3));
$aHeavyVerticalX[$heavyVerticalXCnt++] = $monthX;
$whichMonth = date('n', $dWhichSunday);
$dWhichMonthDate = $dWhichSunday;
@@ -235,14 +235,14 @@ private function getInitialsString() {
$fullNameArr = PersonQuery::create()->select(array('FirstName','LastName'))->findOneById($this->id);
foreach ($fullNameArr as $name)
{
$retstr .= strtoupper(substr($name, 0,1));
$retstr .= mb_strtoupper(mb_substr($name, 0, 1));
}
}
elseif ($this->photoType == "Family" )
{
$fullNameArr = FamilyQuery::create()->findOneById($this->id)->getName();
$retstr .= strtoupper(substr($fullNameArr, 0,1));
$retstr .= mb_strtoupper(mb_substr($fullNameArr, 0, 1));
}
return $retstr;
}
@@ -602,7 +602,7 @@ function FormatFullName($Title, $FirstName, $MiddleName, $LastName, $Suffix, $St
}
$nameString .= $FirstName;
if ($MiddleName) {
$nameString .= ' '.strtoupper(mb_substr($MiddleName, 0, 1, 'UTF-8')).'.';
$nameString .= ' '.mb_strtoupper(mb_substr($MiddleName, 0, 1)).'.';
}
if ($LastName) {
$nameString .= ' '.$LastName;
@@ -637,7 +637,7 @@ function FormatFullName($Title, $FirstName, $MiddleName, $LastName, $Suffix, $St
}
$nameString .= $FirstName;
if ($MiddleName) {
$nameString .= ' '.strtoupper(mb_substr($MiddleName, 0, 1, 'UTF-8')).'.';
$nameString .= ' '.mb_strtoupper(mb_substr($MiddleName, 0, 1)).'.';
}
if ($Suffix) {
$nameString .= ', '.$Suffix;
@@ -11,6 +11,9 @@
exit();
}
/* Set internal character encoding to UTF-8 */
mb_internal_encoding("UTF-8");
function dashesToCamelCase($string, $capitalizeFirstCharacter = false)
{
$str = str_replace(' ', '', ucwords(str_replace('-', ' ', $string)));

0 comments on commit 18fcc78

Please sign in to comment.
You can’t perform that action at this time.