1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-25 16:00:22 +01:00

fix a bug in filename truncation

This commit is contained in:
czaks 2014-07-08 09:56:31 +02:00
parent 806d4da68d
commit 2476648416

View File

@ -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));