$length) { if ($preserve) { if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) { $length = $breakpoint; } } return mb_substr($value, 0, $length) . $separator; } return $value; } function twig_filename_truncate_filter($value, $length = 30, $separator = '…') { if (mb_strlen($value) > $length) { $value = strrev($value); $array = array_reverse(explode(".", $value, 2)); $array = array_map("strrev", $array); $filename = &$array[0]; $extension = isset($array[1]) ? $array[1] : false; $filename = mb_substr($filename, 0, $length - ($extension ? mb_strlen($extension) + 1 : 0)) . $separator; return implode(".", $array); } return $value; } function twig_ratio_function($w, $h) { return fraction($w, $h, ':'); } function twig_secure_link_confirm($text, $title, $confirm_message, $href) { global $config; return '' . $text . ''; } function twig_secure_link($href) { return $href . '/' . make_secure_link_token($href); } function twig_less_ip($ip, $board = '') { return less_ip($ip, $board); }