From 2476648416e6bcc5e0eeb0d5ff6e8d8a9f8e30b9 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 8 Jul 2014 09:56:31 +0200 Subject: [PATCH] fix a bug in filename truncation --- inc/lib/Twig/Extensions/Extension/Tinyboard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/lib/Twig/Extensions/Extension/Tinyboard.php b/inc/lib/Twig/Extensions/Extension/Tinyboard.php index 986ecf45..81276147 100644 --- a/inc/lib/Twig/Extensions/Extension/Tinyboard.php +++ b/inc/lib/Twig/Extensions/Extension/Tinyboard.php @@ -92,7 +92,7 @@ function twig_sprintf_filter( $value, $var) { return sprintf($value, $var); } -function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') { +function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') { if (mb_strlen($value) > $length) { if ($preserve) { if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) { @@ -104,7 +104,7 @@ function twig_truncate_filter($value, $length = 30, $preserve = false, $separato return $value; } -function twig_filename_truncate_filter($value, $length = 30, $separator = '…') { +function twig_filename_truncate_filter($value, $length = 30, $separator = '…') { if (mb_strlen($value) > $length) { $value = strrev($value); $array = array_reverse(explode(".", $value, 2));