This commit is contained in:
czaks 2013-07-31 17:02:30 -04:00
commit c0abd1d851
6 changed files with 12 additions and 12 deletions

View file

@ -83,9 +83,9 @@ function twig_hasPermission_filter($mod, $permission, $board = null) {
}
function twig_extension_filter($value, $case_insensitive = true) {
$ext = substr($value, strrpos($value, '.') + 1);
$ext = mb_substr($value, mb_strrpos($value, '.') + 1);
if($case_insensitive)
$ext = strtolower($ext);
$ext = mb_strtolower($ext);
return $ext;
}
@ -96,11 +96,11 @@ function twig_sprintf_filter( $value, $var) {
function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') {
if (mb_strlen($value) > $length) {
if ($preserve) {
if (false !== ($breakpoint = strpos($value, ' ', $length))) {
if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) {
$length = $breakpoint;
}
}
return substr($value, 0, $length) . $separator;
return mb_substr($value, 0, $length) . $separator;
}
return $value;
}

View file

@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#. There is no previous page.
#: /var/www/html/Tinyboard/inc/functions.php:958