1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Remove mb_strimwidth

This commit is contained in:
Hillel Coren 2017-03-08 08:46:24 +02:00
parent d2076dd268
commit cc9c3a3b30
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;