1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Remove mb_strimwidth

This commit is contained in:
Hillel Coren 2017-03-08 08:47:26 +02:00
parent c843da52d2
commit bc4f70e3ed
3 changed files with 7 additions and 2 deletions

View File

@ -1228,4 +1228,9 @@ class Utils
return round($amount + $tax1 + $tax2, 2);
}
public static function truncateString($string, $length)
{
return strlen($string) > $length ? rtrim(substr($string, 0, $length)) . '...' : $in;
}
}

View File

@ -137,7 +137,7 @@ class Expense extends EntityModel
if ($this->transaction_id) {
return $this->transaction_id;
} elseif ($this->public_notes) {
return mb_strimwidth($this->public_notes, 0, 16, '...');
return Utils::truncateString($this->public_notes, 16);
} else {
return '#' . $this->public_id;
}

View File

@ -196,7 +196,7 @@ class Task extends EntityModel
public function getDisplayName()
{
if ($this->description) {
return mb_strimwidth($this->description, 0, 16, '...');
return Utils::truncateString($this->description, 16);
}
return '#' . $this->public_id;