* Truncate ClamAV output message for log safety. */
(string $msg, int $max)
| 1786 | * Truncate ClamAV output message for log safety. |
| 1787 | */ |
| 1788 | private static function truncateLogMessage(string $msg, int $max): string |
| 1789 | { |
| 1790 | if (mb_strlen($msg, 'UTF-8') <= $max) { |
| 1791 | return $msg; |
| 1792 | } |
| 1793 | return mb_substr($msg, 0, $max, 'UTF-8') . '…'; |
| 1794 | } |
| 1795 | } |